package eio
Install
Dune Dependency
Authors
Maintainers
Sources
sha256=52f85b947d3e0de70940b5bbaac0d3e78841fea5648e73af7d8a754ab51c871b
sha512=944095b1131d2dcc1f0d415fe46fd78b883733e0f95985e3a0feafe73b1703606ec60560abf36c16c364cc60164b7330f236e39569e264c702bb5647e28bfd3c
doc/eio.unix/Eio_unix/index.html
Module Eio_unix
Source
Extension of Eio
for integration with OCaml's Unix
module.
Note that OCaml's Unix
module is not safe, and therefore care must be taken when using these functions. For example, it is possible to leak file descriptors this way, or to use them after they've been closed, allowing one module to corrupt a file belonging to an unrelated module.
A safe wrapper for Unix.file_descr
.
await_readable fd
blocks until fd
is readable (or has an error).
await_writable fd
blocks until fd
is writable (or has an error).
sleep d
sleeps for d
seconds, allowing other fibers to run. This is can be useful for debugging (e.g. to introduce delays to trigger a race condition) without having to plumb Eio.Stdenv.mono_clock
through your code. It can also be used in programs that don't care about tracking determinism.
run_in_systhread fn
runs the function fn
in a newly created system thread (a Thread.t
). This allows blocking calls to be made non-blocking.
pipe sw
returns a connected pair of flows src
and sink
. Data written to sink
can be read from src
. Note that, like all FDs created by Eio, they are both marked as close-on-exec by default.
The set of resources provided to a process on a Unix-compatible system.