package picos

  1. Overview
  2. Docs
Pico scheduler interface

Install

Dune Dependency

Authors

Maintainers

Sources

picos-0.4.0.tbz
sha256=343a8b4759239ca0c107145b8e2cc94c14625fecc0b0887d3c40a9ab7537b8da
sha512=db22b0a5b3adc603c0e815c9011c779f892b9ace76be018b2198d3e24a7d96727c999701025fe5a5fd07d0b452cb7286fc50c939aba0e4dce809941e9ebc12a6

doc/picos.lwt/Picos_lwt/index.html

Module Picos_lwtSource

Direct style Picos compatible interface to Lwt for OCaml 5.

This basically gives you an alternative direct style interface to programming with Lwt. All the scheduling decisions will be made by Lwt.

ℹ️ This is a system independent interface to Lwt. See Picos_lwt_unix for a Unix specific interface.

Sourceval await : 'a Lwt.t -> 'a

await promise awaits for the promise to resolve and returns the result.

⚠️ This may only be called on the main thread on which Lwt runs from inside a fiber started through run.

Sourcemodule type System = sig ... end

Signature for a module that Picos_lwt.run requires for interoperating with the system that Lwt runs on.

Sourceval run : ?forbid:bool -> (module System) -> (unit -> 'a) -> 'a Lwt.t

run (module System) main runs the main program implemented in Picos as a promise with Lwt as the scheduler using the given System module. In other words, the main program will be run as a Lwt promise or fiber.

ℹ️ Inside main you can use anything implemented in Picos for concurrent programming. In particular, you only need to call run with a System module implementation at the entry point of your application.

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

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

OCaml

Innovation. Community. Security.