1+ (* * This is the runtime-events library for lwt. It contains lwt-specific
2+ definition of events (so that programs can be written to consume the events
3+ lwt produces) and the function to emit them (so that lwt can emit them). This
4+ library is not intended for emitting events by hand. *)
5+
6+ (* * Counter event indicatiing the number of paused promise, i.e., the number of
7+ calls to [Lwt.pause] which have not yet been resolved. *)
18type Runtime_events.User.tag + = Paused_count
29val paused_count : int Runtime_events.User .t
310val emit_paused_count : int -> unit
411
12+ (* * Span event indicatiing that [Lwt_main.run] has been called and hasn't
13+ returned yet, i.e., when the Lwt scheduler is running. *)
514type Runtime_events.User.tag + = Scheduler_call
615val sch_call : Runtime_events.Type .span Runtime_events.User .t
716val emit_sch_call_begin : unit -> unit
817val emit_sch_call_end : unit -> unit
918
19+ (* * Punctual event indicatiing that the scheduler is performing one loop. *)
1020type Runtime_events.User.tag + = Scheduler_lap
1121val sch_lap : unit Runtime_events.User .t
1222val emit_sch_lap : unit -> unit
1323
24+ (* * Counter event indicatiing the number of unix I/O jobs, i.e., the number of
25+ calls to [Lwt_unix.*] which have not yet been resolved. *)
1426type Runtime_events.User.tag + = Unix_job_count
1527val unix_job_count : int Runtime_events.User .t
1628val emit_job_count : int -> unit
@@ -19,6 +31,9 @@ module Trace : sig
1931 type t = { kind : Runtime_events.Type .span ; context : string option ; filename : string ; line : int ; }
2032 val t : t Runtime_events.Type .t
2133
34+ (* * Span event indicatiing that a promise is taking time to resolve. The
35+ event indicates the location of the bind for the promise. These events are
36+ automatically emitted by code produced by the lwt_ppx syntax extension. *)
2237 type Runtime_events.User.tag + = T
2338 val span : t Runtime_events.User .t
2439 val emit : t -> unit
0 commit comments