package picos

  1. Overview
  2. Docs

Make (Sleep) creates a Picos compatible interface to Lwt with given implementation of sleep.

For example,

module Picos_lwt_unix = Picos_lwt.Make (Lwt_unix)

instantiates this functor using Lwt_unix.sleep as the implemention of sleep.

Direct style Picos compatible interface to Lwt.

Parameters

module _ : Sleep

Signature

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

run ~forbid main runs the main program implemented in Picos as a promise with Lwt as the scheduler. In other words, the main program will be run as a Lwt promise or fiber.

val await : (unit -> 'a Lwt.t) -> 'a

await thunk awaits for the promise returned by thunk () to resolve and returns the result. This should only be called from inside a fiber started through run.

OCaml

Innovation. Community. Security.