Lwt - API Reference

Core library

The core library (lwt package) contains the Lwt module, which defines cooperative threads with all the primitives to manipulate them. It also provides several general purpose modules, which do not depend on any external package.

Lwt

Module Lwt: cooperative light-weight threads.

Lwt_result

Explicit error handling

Lwt_condition

Conditions

Lwt_list

List helpers

Lwt_mutex

Cooperative locks for mutual exclusion

Lwt_mvar

Mailbox variables

Lwt_pool

External resource pools.

Lwt_stream

Data streams

Lwt_switch

Lwt switches

Lwt_sequence

Mutable sequence of elements (deprecated)

Lwt_pqueue

Functional priority queues (deprecated).

Logger

The lwt.log package provides a logger engine.

Lwt_log_core

Logging facility

This package depends on the core library

Unix bindings

The lwt.unix package provides:

  • the Lwt_unix module, which wrap system calls into cooperative ones
  • the Lwt_io module, which defines cooperative byte channel, in replacement of ones of the standard library
  • module helpers for logging, spawning processes, ...
Lwt_daemon

Daemon helpers

Lwt_gc

Interaction with the garbage collector

Lwt_io

Buffered byte channels

Lwt_log

Logging facility