Go backward to Scheduler : Program SchedulersGo up to 4.1 Types Go forward to MessageQueue : Message Queues |
Selector
: Message Selectorsinterface Selector { Message select(MessageQueue queue); }
A selector returns the next message to be delivered from a channel from the queue of messages stored in the channel; it also updates the queue.
The default selector returns the oldest message in a channel (i.e., the message which was sent first); it is an object of type
class SelectorDefault implements Selector { Message select(MessageQueue queue) { return queue.dequeue(); } }
The default selector may be redefined to implement different kind of channel failure modes (lost messages, duplicated messages, ...).