package picos_lwt

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type

Direct style Picos compatible interface to Lwt with Lwt_unix for OCaml 5.

val run_fiber : Picos.Fiber.t -> (Picos.Fiber.t -> unit) -> unit Lwt.t

run_fiber fiber main runs the main program as the specified fiber as a promise with Lwt as the scheduler using a Lwt_unix based System module. In other words, the main program will be run as a Lwt promise or fiber.

⚠️ This may only be called on the main thread on which Lwt runs.

val run : ?forbid:bool -> (unit -> 'a) -> 'a Lwt.t

run main is equivalent to calling run_fiber with a freshly created fiber and main wrapped to capture the result of main.

The optional forbid argument defaults to false and determines whether propagation of cancelation is initially allowed.

OCaml

Innovation. Community. Security.