diff --git a/src/core/moonpool.ml b/src/core/moonpool.ml index 02a2d009..2d009065 100644 --- a/src/core/moonpool.ml +++ b/src/core/moonpool.ml @@ -16,6 +16,7 @@ let spawn_on_current_runner = Fut.spawn_on_current_runner [@@@ifge 5.0] let await = Fut.await +let yield = Picos.Fiber.yield [@@@endif] diff --git a/src/core/moonpool.mli b/src/core/moonpool.mli index fdb9e520..8f706fdd 100644 --- a/src/core/moonpool.mli +++ b/src/core/moonpool.mli @@ -76,10 +76,16 @@ val get_current_runner : unit -> Runner.t option [@@@ifge 5.0] val await : 'a Fut.t -> 'a -(** Await a future. See {!Fut.await}. +(** Await a future, must be run on a moonpool runner. See {!Fut.await}. Only on OCaml >= 5.0. @since 0.5 *) + +val yield : unit -> unit +(** Yield from the current task, must be run on a moonpool runner. + Only on OCaml >= 5.0. + @since NEXT_RELEASE *) + [@@@endif] module Lock = Lock