Triggers the cancellation of the fiber.
Triggers the cancellation of the fiber.
Returns a new task that will trigger the cancellation upon evaluation. Depending on the implementation, this task might await for all registered finalizers to finish, but this behavior is implementation dependent.
Note that if the background process that's evaluating the result of the underlying fiber is already complete, then there's nothing to cancel.
Returns a new task that will await for the completion of the underlying fiber, (asynchronously) blocking the current run-loop until that result is available.
Fiber
represents the (pure) result of an Async data type (e.g. IO) being started concurrently and that can be either joined or canceled.You can think of fibers as being lightweight threads, a fiber being a concurrency primitive for doing cooperative multi-tasking.
For example a
Fiber
value is the result of evaluating IO.start:Usage example: