package eio

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

Install

Dune Dependency

Authors

Maintainers

Sources

eio-1.2.tbz
sha256=3792e912bd8d494bb2e38f73081825e4d212b1970cf2c1f1b2966caa9fd6bc40
sha512=4a80dbcf8cf2663bdad0f2970871844f37bd293c56bd1ce602910e0a613754945f1f942719f9630906453be7c73c1732dc97526c6c90b0b36100d04fd5e871e4

doc/eio/Eio/Private/Trace/index.html

Module Private.TraceSource

Trace Eio events using OCaml's runtime events system.

Sourcetype id = private int

Each thread/fiber/promise is identified by a unique ID.

Sourceval mint_id : unit -> id

mint_id () is a fresh unique id.

Recording events

Libraries and applications can use these functions to make the traces more useful.

Sourceval log : string -> unit

log msg attaches text msg to the current fiber.

Sourceval name : id -> string -> unit

name id label sets label as the name for id.

Sourceval with_span : string -> (unit -> 'a) -> 'a

with_span op fn runs fn (), labelling the timespan during which it runs with op.

Sourceval suspend_fiber : string -> unit

suspend_fiber op records that the current fiber is now suspended waiting for op.

Recording system events

These are normally only called by the scheduler.

Sourceval create_fiber : cc:id -> id -> unit

create_fiber ~cc id records the creation of fiber id in context cc.

Sourceval create_cc : id -> Eio_runtime_events.cc_ty -> unit

create_cc id ty records the creation of cancellation context id.

Sourceval create_obj : ?label:string -> id -> Eio_runtime_events.obj_ty -> unit

create_obj id ty records the creation of id.

Sourceval get : id -> unit

get src records reading a promise, taking from a stream, taking a lock, etc.

Sourceval try_get : id -> unit

try_get src records that the current fiber wants to get from src (which is not currently ready).

Sourceval put : id -> unit

put dst records resolving a promise, adding to a stream, releasing a lock, etc.

Sourceval fiber : id -> unit

fiber id records that id is now the current fiber for this domain.

Sourceval suspend_domain : Runtime_events.Type.span -> unit

suspend_domain records when the event loop is stopped waiting for events from the OS.

Sourceval domain_spawn : parent:id -> unit

domain_spawn ~parent records that the current domain was spawned by fiber parent.

Sourceval exit_cc : unit -> unit

exit_cc () records that the current CC has finished.

Sourceval exit_fiber : id -> unit

exit_fiber id records that fiber id has finished.

Sourceval error : id -> exn -> unit

error id exn records that id received an error.

OCaml

Innovation. Community. Security.