phasync
Manual / Coroutines

Manual

Coroutines

Start, await and yield: run(), go(), await(), and the model they share.

Introduction#

phasync::run starts the first coroutine and returns once every coroutine it started has ended. phasync::go starts another one without waiting for it, and phasync::await waits for one, returning what it returned or throwing what it threw. Every coroutine belongs to a Frame — the particular run() call that is waiting for it, which decides when a cancellation or a failure reaches it. See Scopes and frames for more on that, and Advanced: Coroutines for how coroutines are scheduled.

Concepts#

Examples#

Reference#