Module Eio_linux

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.

Main Loop

type stdenv = Eio_unix.Stdenv.base
val run : ?config:Eio_unix.Backend_config.t -> ?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.

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 config

    Configuration settings to use. Since 1.7.

  • 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.

  • parameter queue_depth

    Deprecated; use config instead.

  • parameter n_blocks

    Deprecated; use config instead.

  • parameter block_size

    Deprecated; use config instead.

  • parameter polling_timeout

    Deprecated; use config instead.

module Low_level : sig ... end