package eio_main

  1. Overview
  2. Docs
Effect-based direct-style IO mainloop for OCaml

Install

Dune Dependency

Authors

Maintainers

Sources

eio-0.10.tbz
sha256=390f7814507b8133d6c25e3a67a742d731c7ca66252b287b1fb0e3ad4d10eecc
sha512=9c0c9088b178df9799aaae9deb803a802228f1329cbe452479c90e80a13985d9c364ea86ee14e4e759133940f9f6065c7e8ece509d176fb1e347c5320f00a494

doc/eio_main/Eio_main/index.html

Module Eio_mainSource

Select a suitable event loop for Eio.

Sourceval run : (Eio_unix.Stdenv.base -> 'a) -> 'a

run fn runs an event loop and then calls fn env within it.

env provides access to the process's environment (file-system, network, etc).

When fn ends, the event loop finishes.

This should be called once, at the entry point of an application. It must not be called by libraries. Doing so would force the library to depend on Unix (making it unusable from unikernels or browsers), prevent the user from choosing their own event loop, and prevent using the library with other Eio libraries.

run will select an appropriate event loop for the current platform. On many systems, it will use Eio_posix.run.

On recent-enough versions of Linux, it will use Eio_linux.run. You can override this by setting the $EIO_BACKEND environment variable to either "linux", "posix" or "windows".

OCaml

Innovation. Community. Security.