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/src/picos.lwt/intf.ml.html

Source file intf.ml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
module type System = sig
  (** Signature for a module that {!Picos_lwt.run} requires for interoperating
      with the system that {!Lwt} runs on. *)

  val sleep : float -> unit Lwt.t
  (** [sleep seconds] returns a cancelable promise that resolves after the given
      number of seconds. *)

  type trigger
  (** Represents a semi thread-safe signaling mechanism. *)

  val trigger : unit -> trigger
  (** [trigger ()] returns a new thread-safe, single use signaling mechanism.

      ⚠️ This may only be called on the main thread on which {!Lwt} runs. *)

  val signal : trigger -> unit
  (** [signal trigger] resolves the promise that {{!await} [await trigger]}
      returns.

      ℹ️ It must be safe to call [signal] from any thread or domain.  As a
      special case this need not be thread-safe in case the system only allows a
      single thread. *)

  val await : trigger -> unit Lwt.t
  (** [await trigger] returns a promise thet resolves, on the main thread, after
      {{!signal} [signal trigger]} has been called.

      ⚠️ This may only be called on the main thread on which {!Lwt} runs. *)
end
OCaml

Innovation. Community. Security.