package tezos-event-logging

  1. Overview
  2. Docs

Module Internal_event.Lwt_worker_eventSource

The worker event is meant for use with Lwt_utils.worker.

Sourcetype t = {
  1. name : string;
  2. event : [ `Ended | `Failed of string | `Started ];
}
include EVENT with type t := t
include EVENT_DEFINITION with type t := t
Sourceval section : Section.t option

Defines an optional section for the event.

Warning None is only for legacy events and should not be used in new code.

Sourceval name : string

Defines the identifier for the event. Names should be unique and are restricted to alphanumeric characters or ".@-_+=,~".

Sourceval doc : string

A display-friendly text which describes what the event means.

Sourceval pp : short:bool -> Format.formatter -> t -> unit
Sourceval encoding : t Data_encoding.t
Sourceval level : t -> level

Return the preferred level for a given event instance.

Sourceval emit : ?section:Section.t -> (unit -> t) -> unit Tezos_error_monad.Error_monad.tzresult Lwt.t

Output an event of type t, if no sinks are listening the function won't be applied.

Sourceval on_event : string -> [ `Ended | `Failed of string | `Started ] -> unit Lwt.t

on_event msg status emits an event of type t and matches the signature required by Lwt_utils.worker.