package eio
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha256=8ed5c13e6689f31c85dca5f12762d84b8cc0042a7b07d3e464df6eb4b72b3dfc
sha512=46e8f817f32c3316e7f35835a136ad177a295b3306351eb2efa2386482b0169a5b19ed2925b32da2a1f10d40f083fe3d588dd401908f9fec6e4a44cd68535204
doc/eio/Eio/Stdenv/index.html
Module Eio.Stdenv
Source
The standard environment of a process.
All access to the outside world comes from running the event loop, which provides an environment (e.g. an Eio_unix.Stdenv.base
).
Example:
let () =
Eio_main.run @@ fun env ->
Eio.Path.with_open_dir env#fs "/srv/www" @@ fun www ->
serve_files www
~net:env#net
Standard streams
To use these, see Flow
.
File-system access
To use these, see Path
.
cwd t
is the current working directory of the process (this may change over time if the process does a "chdir" operation, which is not recommended).
fs t
is the process's full access to the filesystem.
Paths can be absolute or relative (to the current working directory). Using relative paths with this is similar to using them with cwd
, except that this will follow ".." and symlinks to other parts of the filesystem.
fs
is useful for handling paths passed in by the user.
Network
To use this, see Net
.
net t
gives access to the process's network namespace.
Processes
To use this, see Process
.
process_mgr t
allows you to manage child processes.
Domains (using multiple CPU cores)
To use this, see Domain_manager
.
domain_mgr t
allows running code on other cores.
Time
To use this, see Time
.
clock t
is the system clock (used to get the current time and date).
mono_clock t
is a monotonic clock (used for measuring intervals).
Randomness
secure_random t
is an infinite source of random bytes suitable for cryptographic purposes.
Debugging
debug t
provides privileged controls for debugging.
backend_id t
provides the name of the backend being used.
The possible values are the same as the possible values of the "EIO_BACKEND" environment variable used by Eio_main.run
.