We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
run_main
1 parent 695eb75 commit b006be7Copy full SHA for b006be7
lib/picos_lwt.unix/picos_lwt_unix.ml
@@ -82,3 +82,5 @@ let run ?(forbid = false) main =
82
let fiber = Fiber.create ~forbid computation in
83
let main _ = Computation.capture computation main () in
84
run_fiber fiber main |> Lwt.map @@ fun () -> Computation.peek_exn computation
85
+
86
+let run_main ?forbid main = Lwt_main.run (run ?forbid main)
lib/picos_lwt.unix/picos_lwt_unix.mli
@@ -17,3 +17,6 @@ val run : ?forbid:bool -> (unit -> 'a) -> 'a Lwt.t
17
18
The optional [forbid] argument defaults to [false] and determines whether
19
propagation of cancelation is initially allowed. *)
20
21
+val run_main : ?forbid:bool -> (unit -> 'a) -> 'a
22
+(** [run_main main] is equivalent to {{!run} [Lwt_main.run (run main)]}. *)
0 commit comments