Std.Deferred
Deferred
Section titled “Deferred”effect Deferred[A]A box for one value of type A. dbg shows the capability as <deferred>.
-
fn complete(value: A) -> BoolPuts
valuein the box and returns True the first time. Afterwards does nothing and returns False. Does not suspend. -
suspend fn await() -> AWaits until the box has a value, and returns it. Any number of tasks may wait on one box.
-
fn poll() -> Option[A]The value if the box has one,
Noneotherwise. Does not wait or suspend.
Deferred
Section titled “Deferred”handler Deferred[A]: Deferred[A]Makes an empty box. Its release does nothing.