class Selector

What a Channel.select or Channel.select_loop block registers its operations on. Each method only registers an operation and its block; the chosen operation's block runs after the Channel.select block returns.

<prelude>:6036

Methods

def receive[T](channel: Channel[T], &blk: (T) -> Void) -> Void

Receive from channel: the block gets the value, if this case is the one chosen.

<prelude>:6043

def send[T](channel: Channel[T], value: T, &blk: () -> Void) -> Void

Send value on channel: the block runs once it is sent, if this case is the one chosen.

<prelude>:6046

def after(duration: Duration, &blk: () -> Void) -> Void

A timeout: the block runs if no other case is ready within duration (with several, the shortest wins).

<prelude>:6049

def default(&blk: () -> Void) -> Void

The case chosen when no other is ready at once: it makes the select not wait.

<prelude>:6052

def stop -> Void

Ends a Channel.select_loop after this round.

Called in the Channel.select block itself, before any operation is chosen, it ends the select without performing one.

<prelude>:6057