package lwt

  1. Overview
  2. Docs
Promises and event-driven I/O

Install

Dune Dependency

Authors

Maintainers

Sources

5.9.1.tar.gz
md5=18742da8b8fe3618e3fa700b7a884fe7
sha512=1c51fdb4d0856c89e2df08a1c0095ef28ebd0f613b07b03d0f66501ca5486515562071291e6d0932e57587ed0c9362c8b92c5c9eddb4d2bb2f5e129986b484a7

doc/lwt.unix/Lwt_engine/class-abstract/index.html

Class Lwt_engine.abstractSource

Abstract class for engines.

method destroy : unit

Destroy the engine, remove all its events and free its associated resources.

method transfer : abstract -> unit

transfer engine moves all events from the current engine to engine. Note that timers are reset in the destination engine, i.e. if a timer with a delay of 2 seconds was registered 1 second ago it will occur in 2 seconds in the destination engine.

Event loop methods

method virtual iter : bool -> unit
method fork : unit
method on_readable : Unix.file_descr -> (event -> unit) -> event
method on_writable : Unix.file_descr -> (event -> unit) -> event
method on_timer : float -> bool -> (event -> unit) -> event
method fake_io : Unix.file_descr -> unit
method readable_count : int
method writable_count : int
method timer_count : int
method forwards_signal : int -> bool

Backend methods

Notes:

  • the callback passed to register methods is of type unit -> unit and not event -> unit
  • register methods return a lazy value which unregisters the event when forced
method private virtual cleanup : unit

Cleanup resources associated with the engine.

method private virtual register_readable : Unix.file_descr -> (unit -> unit) -> unit Lazy.t
method private virtual register_writable : Unix.file_descr -> (unit -> unit) -> unit Lazy.t
method private virtual register_timer : float -> bool -> (unit -> unit) -> unit Lazy.t
OCaml

Innovation. Community. Security.