123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116(*****************************************************************************)(* *)(* Open Source License *)(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *)(* Copyright (c) 2018 Nomadic Labs, <contact@nomadic-labs.com> *)(* *)(* Permission is hereby granted, free of charge, to any person obtaining a *)(* copy of this software and associated documentation files (the "Software"),*)(* to deal in the Software without restriction, including without limitation *)(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *)(* and/or sell copies of the Software, and to permit persons to whom the *)(* Software is furnished to do so, subject to the following conditions: *)(* *)(* The above copyright notice and this permission notice shall be included *)(* in all copies or substantial portions of the Software. *)(* *)(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*)(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *)(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *)(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*)(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *)(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *)(* DEALINGS IN THE SOFTWARE. *)(* *)(*****************************************************************************)(** {2 Parameters to build a worker group} *)openError_monad(** The name of the group of workers corresponding to an instantiation
of {!Make}, as well as the name of each worker in that group. *)moduletypeNAME=sig(** The name/path of the worker group *)valbase:stringlist(** The abstract name of a single worker *)typet(** Serializer for the introspection RPCs *)valencoding:tData_encoding.t(** Pretty printer for displaying the worker name *)valpp:Format.formatter->t->unitvalequal:t->t->boolendmoduletypeVIEW=sigtypeviewvalencoding:viewData_encoding.tvalpp:Format.formatter->view->unitend(** Events that are used for logging and introspection.
Events are pretty printed immediately in the log, and stored in
the worker's event backlog for introspection. *)moduletypeEVENT=sig(** The type of an event. *)typetincludeVIEWwithtypeview:=t(** Assigns a logging level to each event.
Events can be ignored for logging w.r.t. the global node configuration.
Events can be ignored for introspection w.r.t. to the worker's
{!Worker_types.limits}. *)vallevel:t->Internal_event.levelend(** The type of messages that are fed to the worker's event loop. *)moduletypeREQUEST=sig(** The type of events.
It is possible to wait for an event to be processed from outside
the worker using {!push_request_and_wait}. In this case, the
handler for this event can return a value. The parameter is the
type of this value. *)type'atincludeVIEW(** The projection function from full request to simple views. *)valview:'at->viewend(** The (imperative) state of the event loop. *)moduletypeTYPES=sig(** The internal state that is passed to the event handlers. *)typestate(** The parameters provided when launching a new worker. *)typeparametersendmoduletypeLOGGER=sigmoduleEvent:EVENTmoduleRequest:VIEWtypestatus=|WorkerEventof(Event.t*Internal_event.level)|Requestof(Request.view*Worker_types.request_status*errorlistoption)|Terminated|Timeout|Crashedoferrorlist|Startedofstringoption|Triggering_shutdown|Duplicateofstringtypet=statusTime.System.stampedmoduleLogEvent:Internal_event.EVENTwithtypet=tend