Picos_structured.ControlSourceBasic control operations and exceptions for structured concurrency.
An exception that is used to signal fibers, typically by canceling them, that they should terminate by letting the exception propagate. This does not, by itself, indicate an error.
An exception that can be used to collect exceptions, typically indicating errors, from multiple fibers.
raise_if_canceled () checks whether the current fiber has been canceled and if so raises the exception that the fiber was canceled with.
yield () asks the current fiber to be rescheduled.
sleep ~seconds suspends the current fiber for specified number of seconds.
protect thunk forbids cancelation for the duration of thunk ().
block () suspends the current fiber until it is canceled at which point the cancelation exception will be raised.
⚠️ Beware that protect block never returns and you don't want that.