package eio

  1. Overview
  2. Docs
Effect-based direct-style IO API for OCaml

Install

Dune Dependency

Authors

Maintainers

Sources

eio-1.0.tbz
sha256=da260d9da38b3dde9f316652a20b13a261cf90b85a2498ac669b7d564e61942d
sha512=5886e1159f48ede237769baa1d8b5daafa0310e4192d7fe0e8c32aef70f2b6378cef72d0fbae308457e25d87a69802b9ee83a5e8f23e0591d83086a92d701c46

doc/eio.mock/Eio_mock/Clock/index.html

Module Eio_mock.ClockSource

A mock Eio.Time clock for testing timeouts.

Note that Backend.run_full provides mock clocks that advance automatically when there is nothing left to do.

Sourcetype 'time ty = [
  1. | `Mock
  2. | 'time Eio.Time.clock_ty
]
Sourcemodule type S = sig ... end
include S with type time := float
Sourcetype t = float ty Eio.Std.r
Sourceval make : unit -> t

make () is a new clock.

The time is initially set to 0.0 and doesn't change except when you call advance or set_time.

Sourceval advance : t -> unit

advance t sets the time to the next scheduled event (adding any due fibers to the run queue).

Sourceval try_advance : t -> bool

Like advance, but returns false instead of raising an exception.

Sourceval set_time : t -> float -> unit

set_time t time sets the time to time (adding any due fibers to the run queue).

Sourcemodule Mono : S with type time := Mtime.t
OCaml

Innovation. Community. Security.