EioEffects based parallel IO for OCaml.
Eio provides support for concurrency (juggling many tasks) and parallelism (using multiple CPU cores for performance).
It provides facilities for creating and coordinating fibers (light-weight threads) and domains (for parallel processing), as well as interfaces for interacting with resources provided by the operating system.
These features must be used within an event loop, provided by an Eio backend. Applications can use Eio_main.run to run a suitable loop.
See https://github.com/ocaml-multicore/eio for a tutorial.
module Std : sig ... endCommonly used standard features. This module is intended to be opened.
module Switch : sig ... endGrouping fibers and other resources so they can be turned off together.
module Fiber : sig ... endA fiber is a light-weight thread.
module Cancel : sig ... endCancelling fibers.
module Promise : sig ... endA promise is a placeholder for result that will arrive in the future.
module Semaphore : sig ... endA counting semaphore.
module Mutex : sig ... endMutual exclusion.
module Condition : sig ... endWaiting for a condition to become true.
module Lazy : sig ... endDelayed evaluation.
module Stream : sig ... endA stream/queue.
module Pool : sig ... endA pool of resources.
module Domain_manager : sig ... endParallel computation across multiple CPU cores.
module Executor_pool : sig ... endA pool of domains for executing jobs.
val traceln : 
  ?__POS__:(string * int * int * int) ->
  ('a, Format.formatter, unit, unit) format4 ->
  'atraceln fmt outputs a debug message (typically to stderr).
Trace messages are printed by default and do not require logging to be configured first. The message is printed with a newline, and is flushed automatically. traceln is intended for quick debugging rather than for production code.
Unlike most Eio operations, traceln will never switch to another fiber; if the OS is not ready to accept the message then the whole domain waits.
It is safe to call traceln from multiple domains at the same time. Each line will be written atomically.
Examples:
traceln "x = %d" x;
traceln "x = %d" x ~__POS__;   (* With location information *)module Exn : sig ... endEio exceptions.
exception Io of Exn.err * Exn.contextmodule Debug : sig ... endControl over debugging.
The general pattern here is that each type of resource has a set of functions for using it, plus a provider (Pi) module to allow defining your own implementations.
The system resources are available from the environment argument provided by your event loop (e.g. Eio_main.run).
module Resource : sig ... endDefines the base resource type.
module Flow : sig ... endA flow can be used to read or write bytes.
module Buf_read : sig ... endBuffered input and parsing.
module Buf_write : sig ... endBuffered output and formatting.
module Net : sig ... endNetwork sockets and addresses.
module Path : sig ... endAccessing paths on a file-system.
module File : sig ... endOperations on open files.
module Fs : sig ... endFile-system types.
module Process : sig ... endManaging child processes.
module Time : sig ... endClocks, time, sleeping and timeouts.
module Stdenv : sig ... endThe standard environment of a process.
module Private : sig ... endAPI for use by the scheduler implementation.