mirror of
https://github.com/c-cube/moonpool.git
synced 2025-12-10 21:24:05 -05:00
moonpool: expose Fut.{spawn_on_current_runner,await}
This commit is contained in:
parent
989c012f77
commit
3f7ed7b6b8
2 changed files with 20 additions and 0 deletions
|
|
@ -5,6 +5,13 @@ let start_thread_on_some_domain f x =
|
||||||
let run_async = Runner.run_async
|
let run_async = Runner.run_async
|
||||||
let recommended_thread_count () = Domain_.recommended_number ()
|
let recommended_thread_count () = Domain_.recommended_number ()
|
||||||
let spawn = Fut.spawn
|
let spawn = Fut.spawn
|
||||||
|
let spawn_on_current_runner = Fut.spawn_on_current_runner
|
||||||
|
|
||||||
|
[@@@ifge 5.0]
|
||||||
|
|
||||||
|
let await = Fut.await
|
||||||
|
|
||||||
|
[@@@endif]
|
||||||
|
|
||||||
module Atomic = Atomic_
|
module Atomic = Atomic_
|
||||||
module Blocking_queue = Bb_queue
|
module Blocking_queue = Bb_queue
|
||||||
|
|
|
||||||
|
|
@ -40,6 +40,19 @@ val spawn : on:Runner.t -> (unit -> 'a) -> 'a Fut.t
|
||||||
and returns a future result for it. See {!Fut.spawn}.
|
and returns a future result for it. See {!Fut.spawn}.
|
||||||
@since NEXT_RELEASE *)
|
@since NEXT_RELEASE *)
|
||||||
|
|
||||||
|
val spawn_on_current_runner : (unit -> 'a) -> 'a Fut.t
|
||||||
|
(** See {!Fut.spawn_on_current_runner}.
|
||||||
|
@since NEXT_RELEASE *)
|
||||||
|
|
||||||
|
[@@@ifge 5.0]
|
||||||
|
|
||||||
|
val await : 'a Fut.t -> 'a
|
||||||
|
(** Await a future. See {!Fut.await}.
|
||||||
|
Only on OCaml >= 5.0.
|
||||||
|
@since NEXT_RELEASE *)
|
||||||
|
|
||||||
|
[@@@endif]
|
||||||
|
|
||||||
module Lock = Lock
|
module Lock = Lock
|
||||||
module Fut = Fut
|
module Fut = Fut
|
||||||
module Chan = Chan
|
module Chan = Chan
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue