Internal_event.SINKAn implementation of SINK is responsible for handling/storing events, for instance, a sink could be output to a file, to a database, or a simple "memory-less" forwarding mechanism.
A sink can store any required state, e.g. a database handle, in a value of the t type see configure.
val configure : Uri.t -> t Mavryk_error_monad.Error_monad.tzresult Lwt.tWhen a registered sink is activated the configure function is called to initialize it. The parameters should be encoded or obtained from the URI (the scheme of the URI is already uri_scheme).
val should_handle : ?section:Section.t -> t -> _ event_definition -> boolPredicate deciding whether a sink should handle the event or not.
val handle :
t ->
'a event_definition ->
?section:Section.t ->
'a ->
unit Mavryk_error_monad.Error_monad.tzresult Lwt.tA sink's main function is to handle incoming events from the code base.
val close : t -> unit Mavryk_error_monad.Error_monad.tzresult Lwt.tA function to be called on graceful termination of processes (e.g. to flush file-descriptors, etc.).