mirror of
https://github.com/c-cube/moonpool.git
synced 2025-12-16 15:56:21 -05:00
Compare commits
No commits in common. "a6e59522ed7552f236650dacad9afe2e377f73ea" and "f041520b82c411382c54685a822b62c5174f02f3" have entirely different histories.
a6e59522ed
...
f041520b82
3 changed files with 1 additions and 11 deletions
|
|
@ -306,9 +306,6 @@ let spawn_lwt f : _ Lwt.t =
|
|||
with exn -> Lwt.wakeup_exn lwt_prom exn);
|
||||
lwt_fut
|
||||
|
||||
let spawn_lwt_ignore f = ignore (spawn_lwt f : unit Lwt.t)
|
||||
let on_lwt_thread = Main_state.on_lwt_thread
|
||||
|
||||
let lwt_main (f : _ -> 'a) : 'a =
|
||||
let st = setup () in
|
||||
(* make sure to cleanup *)
|
||||
|
|
|
|||
|
|
@ -27,9 +27,6 @@ val spawn_lwt : (unit -> 'a) -> 'a Lwt.t
|
|||
(** This spawns a task that runs in the Lwt scheduler.
|
||||
@raise Failure if {!lwt_main} was not called. *)
|
||||
|
||||
val spawn_lwt_ignore : (unit -> unit) -> unit
|
||||
(** Like {!spawn_lwt} but ignores the result, like [Lwt.async]. *)
|
||||
|
||||
val await_lwt : 'a Lwt.t -> 'a
|
||||
(** [await_lwt fut] awaits a Lwt future from inside a task running on a moonpool
|
||||
runner. This must be run from within a Moonpool runner so that the await-ing
|
||||
|
|
@ -45,11 +42,6 @@ val lwt_main : (Moonpool.Runner.t -> 'a) -> 'a
|
|||
(** [lwt_main f] sets the moonpool-lwt bridge up, runs lwt main, calls [f],
|
||||
destroys the bridge, and return the result of [f()]. *)
|
||||
|
||||
val on_lwt_thread : unit -> bool
|
||||
(** [on_lwt_thread ()] is true if the current thread is the one currently
|
||||
running {!lwt_main}.
|
||||
@raise Failure if {!lwt_main} was not called. *)
|
||||
|
||||
val lwt_main_runner : unit -> Moonpool.Runner.t
|
||||
(** The runner from {!lwt_main}. The runner is only going to work if {!lwt_main}
|
||||
is currently running in some thread.
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
open! Moonpool
|
||||
module M_lwt = Moonpool_lwt
|
||||
|
||||
let ( let@ ) = ( @@ )
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue