Reads a value from the channel. If there are no values, blocks until
there is
If channel is buffered, takes next value from the buffer. This unblocks
first of blocked WritableChannel.write calls if there are any
If channel is unbuffered, simply unblocks the first of blocked
WritableChannel.write
If the channel is closed and has no values left in the buffer,
returns undefined
Concurrent calls are allowed - each read will get own value (no
two reads will get the same value). If multiple calls are blocked,
they will unblock one-by-one in unspecified order
Note: each blocked call occupies memory, and there is no limit on
how many calls there can be at once. Typically, programs have a fixed
or a finite number of reads, so this should not be a problem
Reads a value from the channel. If there are no values, blocks until there is
If channel is buffered, takes next value from the buffer. This unblocks first of blocked WritableChannel.write calls if there are any
If channel is unbuffered, simply unblocks the first of blocked WritableChannel.write
If the channel is closed and has no values left in the buffer, returns
undefined
Concurrent calls are allowed - each read will get own value (no two reads will get the same value). If multiple calls are blocked, they will unblock one-by-one in unspecified order