mirror of
https://github.com/c-cube/moonpool.git
synced 2025-12-05 19:00:33 -05:00
do not expose ?ls for Fut.spawn
This commit is contained in:
parent
8614d4be40
commit
83ae0e7a4e
3 changed files with 8 additions and 12 deletions
|
|
@ -97,7 +97,7 @@ let[@inline] fulfill_idempotent self r =
|
|||
|
||||
(* ### combinators ### *)
|
||||
|
||||
let spawn ?ls ~on f : _ t =
|
||||
let spawn ~on f : _ t =
|
||||
let fut, promise = make () in
|
||||
|
||||
let task () =
|
||||
|
|
@ -110,13 +110,13 @@ let spawn ?ls ~on f : _ t =
|
|||
fulfill promise res
|
||||
in
|
||||
|
||||
Runner.run_async ?ls on task;
|
||||
Runner.run_async on task;
|
||||
fut
|
||||
|
||||
let spawn_on_current_runner ?ls f : _ t =
|
||||
let spawn_on_current_runner f : _ t =
|
||||
match Runner.get_current_runner () with
|
||||
| None -> failwith "Fut.spawn_on_current_runner: not running on a runner"
|
||||
| Some on -> spawn ?ls ~on f
|
||||
| Some on -> spawn ~on f
|
||||
|
||||
let reify_error (f : 'a t) : 'a or_error t =
|
||||
match peek f with
|
||||
|
|
|
|||
|
|
@ -93,13 +93,11 @@ val is_failed : _ t -> bool
|
|||
|
||||
(** {2 Combinators} *)
|
||||
|
||||
val spawn :
|
||||
?ls:Task_local_storage.storage -> on:Runner.t -> (unit -> 'a) -> 'a t
|
||||
val spawn : on:Runner.t -> (unit -> 'a) -> 'a t
|
||||
(** [spaw ~on f] runs [f()] on the given runner [on], and return a future that will
|
||||
hold its result. *)
|
||||
|
||||
val spawn_on_current_runner :
|
||||
?ls:Task_local_storage.storage -> (unit -> 'a) -> 'a t
|
||||
val spawn_on_current_runner : (unit -> 'a) -> 'a t
|
||||
(** This must be run from inside a runner, and schedules
|
||||
the new task on it as well.
|
||||
|
||||
|
|
|
|||
|
|
@ -52,14 +52,12 @@ val recommended_thread_count : unit -> int
|
|||
this because many of them will be blocked most of the time).
|
||||
@since 0.5 *)
|
||||
|
||||
val spawn :
|
||||
?ls:Task_local_storage.storage -> on:Runner.t -> (unit -> 'a) -> 'a Fut.t
|
||||
val spawn : on:Runner.t -> (unit -> 'a) -> 'a Fut.t
|
||||
(** [spawn ~on f] runs [f()] on the runner (a thread pool typically)
|
||||
and returns a future result for it. See {!Fut.spawn}.
|
||||
@since 0.5 *)
|
||||
|
||||
val spawn_on_current_runner :
|
||||
?ls:Task_local_storage.storage -> (unit -> 'a) -> 'a Fut.t
|
||||
val spawn_on_current_runner : (unit -> 'a) -> 'a Fut.t
|
||||
(** See {!Fut.spawn_on_current_runner}.
|
||||
@since 0.5 *)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue