- Types of Objects
- Processes
- Provided Clauses
- Data Objects
- Data Structures
- Message Channels
- Channel Poll Operations
- Sorted Send And Random Receive
- Rendezvous Communication
- Rules For Executability
- Assignments And Expressions
- Control Flow: Compound Statements
- Atomic Sequences
- Deterministic Steps
- Selection
- Repetition
- Escape Sequences
- Inline Definitions
- Reading Input
- Special Features
- Finding Out More
Channel Poll Operations
It is also possible to limit the effect of a receive statement to just the copying of parameter values from message fields, without removing the message from the channel. These operations are called channel poll operations. Any receive statement can be turned into a poll operation by placing angle brackets around its list of parameters. For instance, assuming that we have declared a channel q with two message fields of type int, the receive statement
q?<eval(y),x>
where x and y are variables, is executable only if channel q contains at least one message and if the first field in that message has a value that is equal to the current value of variable y. When the statement is executed the value of the second field in the incoming message is copied into variable x, but the message itself is not removed from the channel.