Fiber
A datatype that represents a handle to a fiber and allows for waiting and
cancellation against that fiber.
cancellation against that fiber.
- See also
- GenSpawn documentation for more detailed information on the
concurrency of fibers.
class Object
trait Matchable
class Any
Value members
Methods
Requests the cancellation of the fiber bound to this
and awaits its finalization.
Fiber
handleand awaits its finalization.
cancel semantically blocks the caller until finalization of the
cancellee has completed. This means that if the cancellee is currently
masked, cancel will block until it is unmasked and finalized.
cancellee has completed. This means that if the cancellee is currently
masked, cancel will block until it is unmasked and finalized.
Cancellation is idempotent, so repeated calls to cancel simply block
until finalization is complete. If cancel is called after finalization
is complete, it will return immediately.
until finalization is complete. If cancel is called after finalization
is complete, it will return immediately.
cancel is uncancelable; a fiber that is canceling another fiber
is masked from cancellation.
is masked from cancellation.
- See also
- GenSpawn documentation for more details on cancellation
Awaits the completion of the bound fiber and returns its result once
it completes.
it completes.
If the fiber completes with Outcome.Succeeded, the successful value is
returned. If the fiber completes with Outcome.Errored, the error is raised.
If the fiber completes with Outcome.Canceled,
returned. If the fiber completes with Outcome.Errored, the error is raised.
If the fiber completes with Outcome.Canceled,
onCancel
is run.Awaits the completion of the bound fiber and returns its result once
it completes.
it completes.
If the fiber completes with Outcome.Succeeded, the successful value is
returned. If the fiber completes with Outcome.Errored, the error is raised.
If the fiber completes with Outcome.Canceled, the caller is indefinitely
suspended without termination.
returned. If the fiber completes with Outcome.Errored, the error is raised.
If the fiber completes with Outcome.Canceled, the caller is indefinitely
suspended without termination.