package eio_linux

  1. Overview
  2. Docs
Eio implementation for Linux using io-uring

Install

dune-project
 Dependency

Authors

Maintainers

Sources

eio-0.8.1.tbz
sha256=c4222f9b081465486a1c1a8dde6aa00178936d7c7b3a8565e0883a421e0e3547
sha512=d63d8b9500b492be93df4f29159aa6955588ca1e35e6a5817856e32ee4fec3395604dc7b64fc5a973ee8bd436bd65831e7b08fca9bf909f41afec4a65c4443b8

doc/eio_linux/Eio_linux/index.html

Module Eio_linuxSource

Eio backend using Linux's io_uring.

You will normally not use this module directly. Instead, use Eio_main.run to start an event loop and then use the API in the Eio module.

However, it is possible to use this module directly if you only want to support recent versions of Linux.

Sourcemodule FD : sig ... end

Wrap Unix.file_descr to track whether it has been closed.

Eio API

Sourcetype has_fd = < fd : FD.t >
Sourcetype stdenv = < stdin : source ; stdout : sink ; stderr : sink ; net : Eio.Net.t ; domain_mgr : Eio.Domain_manager.t ; clock : Eio.Time.clock ; mono_clock : Eio.Time.Mono.t ; fs : Eio.Fs.dir Eio.Path.t ; cwd : Eio.Fs.dir Eio.Path.t ; secure_random : Eio.Flow.source ; debug : Eio.Debug.t >
Sourceval get_fd : < has_fd.. > -> FD.t
Sourceval get_fd_opt : Eio.Generic.t -> FD.t option

Main Loop

Sourceval run : ?queue_depth:int -> ?n_blocks:int -> ?block_size:int -> ?polling_timeout:int -> ?fallback:([ `Msg of string ] -> 'a) -> (stdenv -> 'a) -> 'a

Run an event loop using io_uring.

Uses Uring.create to create the io_uring, and Uring.set_fixed_buffer to set a block_size * n_blocks fixed buffer.

Note that if Linux resource limits prevent the requested fixed buffer from being allocated then run will continue without one (and log a warning).

For portable code, you should use Eio_main.run instead, which will use this automatically if running on Linux with a recent-enough kernel version.

  • parameter fallback

    Call this instead if io_uring is not available for some reason. The argument is a message describing the problem (for logging). The default simply raises an exception.

Low-level API

Sourcemodule Low_level : sig ... end

Low-level API for using uring directly.