package octez-libs
The callback handlers specific to each worker instance.
val on_launch :
self ->
Name.t ->
Types.parameters ->
(Types.state, launch_error) result Lwt.t
Builds the initial internal state of a worker at launch. It is possible to initialize the message queue. Of course calling state
will fail at that point.
The main request processor, i.e. the body of the event loop.
Called when no request has been made before the timeout, if the parameter has been passed to launch
.
val on_error :
self ->
Tezos_base.Worker_types.request_status ->
('a, 'request_error) Request.t ->
'request_error ->
unit Tezos_base.TzPervasives.tzresult Lwt.t
A function called at the end of the worker loop in case of an error. One can first log the incoming error. Then, the error can be filtered out by returning return_unit
and the worker execution continues, or the error can be propagated through a tzresult
, making the worker crash.
val on_completion :
self ->
('a, 'request_error) Request.t ->
'a ->
Tezos_base.Worker_types.request_status ->
unit Lwt.t
A function called at the end of the worker loop in case of a successful treatment of the current request.