OxL Справочник OxL
РусскийEnglish

method Sender.send

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

Example:

oxl✓ проверяется в CI
fn main() io {
  let (tx, rx) = chan<i64>(cap: 1)
  tx.send(5)!
  print("{rx.recv()!}")
}
Вывод
5
pub(api) fn send(x: T) -> () | Closed

С версии. 1.0.0-beta

Параметры

ИмяТип
xT

Возвращает

()

Ошибки

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

Эффекты

не объявлены (чистая, пока тело не говорит иное)

Определено в: std/core/task.oxl:84

См. также