package fuseau
-
fuseau.unix
Legend:
Library
Module
Module type
Parameter
Class
Class type
Library
Module
Module type
Parameter
Class
Class type
Fibers.
A fiber is a lightweight cooperative thread. It runs on the scheduler and can yield to other fibers, notably on IO polling points.
type 'a callback = 'a Exn_bt.result -> unit
Callbacks that are called when a fiber is done.
type cancel_callback = Exn_bt.t -> unit
val return : 'a -> 'a t
val peek : 'a t -> 'a Exn_bt.result option
val is_cancelled : _ t -> bool
val is_done : _ t -> bool
exception Cancelled of Exn_bt.t
Wait for fiber to be done and call the callback with the result. If the fiber is done already then the callback is invoked immediately with its result.
val get_current : unit -> any
get_current ()
returns the currently running fiber.