feat: add Moonpool.yield on ocaml 5

a mere alias to Picos.Fiber.yield
This commit is contained in:
Simon Cruanes 2025-05-02 10:33:30 -04:00
parent ed0eda226c
commit b46a048401
No known key found for this signature in database
GPG key ID: EBFFF6F283F3A2B4
2 changed files with 8 additions and 1 deletions

View file

@ -16,6 +16,7 @@ let spawn_on_current_runner = Fut.spawn_on_current_runner
[@@@ifge 5.0] [@@@ifge 5.0]
let await = Fut.await let await = Fut.await
let yield = Picos.Fiber.yield
[@@@endif] [@@@endif]

View file

@ -76,10 +76,16 @@ val get_current_runner : unit -> Runner.t option
[@@@ifge 5.0] [@@@ifge 5.0]
val await : 'a Fut.t -> 'a 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. Only on OCaml >= 5.0.
@since 0.5 *) @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] [@@@endif]
module Lock = Lock module Lock = Lock