package eio_main

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

Install

Dune Dependency

Authors

Maintainers

Sources

eio-0.13.tbz
sha256=82537ee1c5b1829fde8207614a4e39f560bd582332841290ed5ef76691f3af70
sha512=69fc509e5ed34da64c3c26fa22558ce7f0cb42afa65c864c57dbb05948e12c0f4f6ab7b77a07f8b292ea3a18748ed46deb9da6af74852115da5e938177b3bf18

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). env itself and the resources inside it can be shared safely between Eio domains.

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.