OxL Reference

method Sender.send

Sends a value, waiting while the buffer is full; Closed if the receiver is gone.

Example:

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

Since. 1.0.0-beta

Parameters

NameType
xT

Returns

()

Errors

  • Closed @error
  • `Closed` when the receiver is gone.

Effects

none declared (pure unless the body says otherwise)

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

See also