package eio
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha256=8ed5c13e6689f31c85dca5f12762d84b8cc0042a7b07d3e464df6eb4b72b3dfc
sha512=46e8f817f32c3316e7f35835a136ad177a295b3306351eb2efa2386482b0169a5b19ed2925b32da2a1f10d40f083fe3d588dd401908f9fec6e4a44cd68535204
doc/eio.runtime_events/Eio_runtime_events/index.html
Module Eio_runtime_events
Source
This library is used to write event traces using OCaml's runtime events infrastructure.
Writing events
Consuming events
type event = [
| `Create of id * [ `Fiber_in of id | `Cc of cc_ty | `Obj of obj_ty ]
| `Fiber of id
(*The given fiber is now running.
*)| `Name of id * string
(*Names a promise, stream, etc.
*)| `Log of string
(*The running fiber logs a message.
*)| `Enter_span of string
(*The running fiber enters a traced section.
*)| `Exit_span
(*The running fiber leaves the current traced section.
*)| `Get of id
(*The running fiber gets a value from a promise, stream, acquires a lock, etc.
*)| `Try_get of id
(*The running fiber wants to get, but must wait.
*)| `Put of id
(*The running fiber resolves a promise, adds to a stream, releases a lock etc.
*)| `Error of id * string
(*A CC fails with the given error.
*)| `Exit_cc
(*The current CC ends.
*)| `Exit_fiber of id
(*The running fiber ends.
*)| `Suspend_domain of Runtime_events.Type.span
(*The domain asks the OS to wait for events.
*)| `Suspend_fiber of string
(*The running fiber is suspended (until resumed by
*)`Fiber
).| `Domain_spawn of id
(*The current domain was spawned by fiber
*)id
.
]
pp_event
formats an event as a human-readable string
val add_callbacks :
(int -> Runtime_events.Timestamp.t -> event -> unit) ->
Runtime_events.Callbacks.t ->
Runtime_events.Callbacks.t
add_callbacks fn x
adds event handler fn
to x
.
When an Eio event is processed, it calls fn ring_id ts event
.