package mariadb

  1. Overview
  2. Docs

Module Mariadb.NonblockingSource

This is the nonblocking MariaDB API. The interface contains a functor Make which, given a way to wait for a connection socket to be ready for reading or writing, returns a module with the same signature S as the traditional blocking API.

Sourcemodule Status : sig ... end
Sourcetype t

The type of nonblocking database handles.

The underlying file descriptor of the database connection.

Sourceval timeout : t -> int

If a nonblocking operation returns a Status.t indicating a timeout event, this function can be used to obtain the value, in seconds, after which the timeout has occured.

Sourceval timeout_ms : t -> int

Same as timeout but with millisecond resolution.

Sourcemodule type Wait = sig ... end

Input module signature for the functor that generates a nonblocking connection module.

Sourcemodule type S = sig ... end
Sourcemodule Make (W : Wait) : S with type 'a future := 'a W.IO.future

Functor that generates a nonblocking database interface, given a nonblocking IO monad and a way to wait for connection socket events.