package eio_main

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

Install

Dune Dependency

Authors

Maintainers

Sources

eio-1.0.tbz
sha256=da260d9da38b3dde9f316652a20b13a261cf90b85a2498ac669b7d564e61942d
sha512=5886e1159f48ede237769baa1d8b5daafa0310e4192d7fe0e8c32aef70f2b6378cef72d0fbae308457e25d87a69802b9ee83a5e8f23e0591d83086a92d701c46

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.