package miou

  1. Overview
  2. Docs
Composable concurrency primitives for OCaml

Install

dune-project
 Dependency

Authors

Maintainers

Sources

miou-0.10.0.tbz
sha256=bf1954c6f66ac9d306b3b4f948b19f59d2c327213af930e19d9fbc73f134fa18
sha512=cea8136bf9fef32898c962b4136fd784a20fc8a6626cd19bb7d0a37e798aa7a7f06ea9f19b47f6e03bb1afd477cf46e57d4c6a376601eb282c4fb07d490ca727

doc/miou.runtime_events/Miou_runtime_events/index.html

Module Miou_runtime_eventsSource

The Miou Trace system with Runtime_events.

This module allows you to connect the trace data output by Miou to the Runtime_events module provided by OCaml using the reporter function. To ensure that the user has a trace of Miou events, they must call Miou.Trace.set_reporter Miou_runtime_events.reporter. It should be noted that the trace is only emitted if the environment variable MIOU_TRACE=1 exists.

This module also allows a consumer to be associated with Miou events using add_callbacks. In this way, the user, using the Runtime_events module, can obtain Miou events from a program via a cursor.

Sourceval reporter : Miou.Trace.event -> unit

reporter is a function to connect the Trace producer to the Runtime_events producer. If the user would like to emit trace from a Miou application, the program must be executed with MIOU_TRACE=1 and:

let () = Miou.Trace.set_reporter Miou_runtime_events.reporter

add_callbacks ~fn cbs adds a consumer fn for Miou events.

  let cursor = Runtime_events.create_cursor (Some (cwd, pid)) in
  let cbs = Runtime_events.Callbacks.create () in
  let cbs = Miou_runtime_events.add_callbacks ~fn cbs in
  ...
  let _ = Runtime_events.read_poll cursor cbs None in
  ...
  Runtime_events.free_cursor cursor