diff --git a/moonpool/Moonpool_fib/index.html b/moonpool/Moonpool_fib/index.html index 902f8a4b..1e177f9a 100644 --- a/moonpool/Moonpool_fib/index.html +++ b/moonpool/Moonpool_fib/index.html @@ -1,2 +1,2 @@ -
Moonpool_fibFiber for moonpool
module Fiber : sig ... endFibers.
module Fls : sig ... endFiber-local storage.
module Handle : sig ... endThe unique name of a fiber.
module Main : sig ... endMain thread.
include module type of struct include Fiber endtype cancel_callback = Moonpool.Exn_bt.t -> unitA callback used in case of cancellation
type 'a t = 'a Fiber.{Private_}1.tA fiber returning a value of type 'a.
val res : 'a t -> 'a Moonpool.Fut.tFuture result of the fiber.
type 'a callback = 'a Moonpool.Exn_bt.result -> unitCallbacks that are called when a fiber is done.
Type erased fiber
val return : 'a -> 'a tval fail : Moonpool.Exn_bt.t -> _ tval self : unit -> anyself () is the current fiber. Must be run from inside a fiber.
val peek : 'a t -> 'a Moonpool.Fut.or_error optionPeek inside the future result
val is_done : _ t -> boolHas the fiber completed?
val is_cancelled : _ t -> boolHas the fiber completed with a failure?
val is_success : _ t -> boolHas the fiber completed with a value?
val await : 'a t -> 'aawait fib is like Fut.await (res fib)
val wait_block_exn : 'a t -> 'await_block_exn fib is Fut.wait_block_exn (res fib). NOTE: See Fut.wait_block for warnings about deadlocks.
val wait_block : 'a t -> 'a Moonpool.Fut.or_errorwait_block fib is Fut.wait_block (res fib). NOTE: See Fut.wait_block for warnings about deadlocks.
Check if the current fiber is cancelled, in which case this raises. Must be run from inside a fiber.
type cancel_handle = Fiber.cancel_handleAn opaque handle for a single cancel callback in a fiber
val add_on_cancel : _ t -> cancel_callback -> cancel_handleadd_on_cancel fib cb adds cb to the list of cancel callbacks for fib. If fib is already cancelled, cb is called immediately.
val remove_on_cancel : _ t -> cancel_handle -> unitremove_on_cancel fib h removes the cancel callback associated with handle h.
val with_cancel_callback : _ t -> cancel_callback -> (unit -> 'a) -> 'awith_cancel_callback fib cb (fun () -> <e>) evaluates e in a scope in which, if the fiber fib is cancelled, cb() is called. If e returns without the fiber being cancelled, this callback is removed.
val with_self_cancel_callback : cancel_callback -> (unit -> 'a) -> 'awith_self_cancel_callback cb f calls f() in a scope where cb is added to the cancel callbacks of the current fiber
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 spawn_top : on:Moonpool.Runner.t -> (unit -> 'a) -> 'a tspawn_top ~on f spawns a new (toplevel) fiber onto the given runner. This fiber is not the child of any other fiber: its lifetime is only determined by the lifetime of f().
val spawn : ?protect:bool -> (unit -> 'a) -> 'a tspawn ~protect f spawns a sub-fiber f_child from a running fiber parent. The sub-fiber f_child is attached to the current fiber and fails if the current fiber parent fails.
val main : (Moonpool.Runner.t -> 'a) -> 'aMoonpool_fibFiber for moonpool
module Fiber : sig ... endFibers.
module Fls : sig ... endFiber-local storage.
module Handle : sig ... endThe unique name of a fiber.
module Main : sig ... endMain thread.
include module type of struct include Fiber endtype cancel_callback = Moonpool.Exn_bt.t -> unitA callback used in case of cancellation
type 'a t = 'a Fiber.{Private_}1.tA fiber returning a value of type 'a.
val res : 'a t -> 'a Moonpool.Fut.tFuture result of the fiber.
type 'a callback = 'a Moonpool.Exn_bt.result -> unitCallbacks that are called when a fiber is done.
Type erased fiber
val return : 'a -> 'a tval fail : Moonpool.Exn_bt.t -> _ tval self : unit -> anyself () is the current fiber. Must be run from inside a fiber.
val peek : 'a t -> 'a Moonpool.Fut.or_error optionPeek inside the future result
val is_done : _ t -> boolHas the fiber completed?
val is_cancelled : _ t -> boolHas the fiber completed with a failure?
val is_success : _ t -> boolHas the fiber completed with a value?
val await : 'a t -> 'aawait fib is like Fut.await (res fib)
val wait_block_exn : 'a t -> 'await_block_exn fib is Fut.wait_block_exn (res fib). NOTE: See Fut.wait_block for warnings about deadlocks.
val wait_block : 'a t -> 'a Moonpool.Fut.or_errorwait_block fib is Fut.wait_block (res fib). NOTE: See Fut.wait_block for warnings about deadlocks.
Check if the current fiber is cancelled, in which case this raises. Must be run from inside a fiber.
type cancel_handle = Fiber.cancel_handleAn opaque handle for a single cancel callback in a fiber
val add_on_cancel : _ t -> cancel_callback -> cancel_handleadd_on_cancel fib cb adds cb to the list of cancel callbacks for fib. If fib is already cancelled, cb is called immediately.
val remove_on_cancel : _ t -> cancel_handle -> unitremove_on_cancel fib h removes the cancel callback associated with handle h.
val with_cancel_callback : _ t -> cancel_callback -> (unit -> 'a) -> 'awith_cancel_callback fib cb (fun () -> <e>) evaluates e in a scope in which, if the fiber fib is cancelled, cb() is called. If e returns without the fiber being cancelled, this callback is removed.
val with_self_cancel_callback : cancel_callback -> (unit -> 'a) -> 'awith_self_cancel_callback cb f calls f() in a scope where cb is added to the cancel callbacks of the current fiber
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 spawn_top : on:Moonpool.Runner.t -> (unit -> 'a) -> 'a tspawn_top ~on f spawns a new (toplevel) fiber onto the given runner. This fiber is not the child of any other fiber: its lifetime is only determined by the lifetime of f().
val spawn : ?protect:bool -> (unit -> 'a) -> 'a tspawn ~protect f spawns a sub-fiber f_child from a running fiber parent. The sub-fiber f_child is attached to the current fiber and fails if the current fiber parent fails.
include module type of struct include Main endval main : (Moonpool.Runner.t -> 'a) -> 'amain f runs f() in a scope that handles effects, including Fiber.await.
This scope can run background tasks as well, in a cooperative fashion.