OxL Reference

method Receiver.recv

Receives a value, waiting while the channel is empty; Closed after all senders are gone.

Example:

oxl✓ checked in CI
fn main() io {
  let (tx, rx) = chan<i64>(cap: 1)
  tx.send(9)!
  print("{rx.recv()!}")
}
Output
9
pub(api) fn recv() -> T | Closed

Since. 1.0.0-beta

Returns

T

Errors

  • Closed @error
  • `Closed` after all senders are gone and the buffer is empty.

Effects

none declared (pure unless the body says otherwise)

Defined in: std/core/task.oxl:119

See also