Module External_process.Make

Functor used to create a module that can launch and communicate with an external process dedicated to handling certain requests.

Parameters

Signature

type t

The type of external processes.

val restart_hypervisee : t -> unit Tezos_base.TzPervasives.tzresult Lwt.t

restart_hypervisee p asks the hypervisor to restart the hypervisee process.

val init : P.parameters -> process_path:string -> t Tezos_base.TzPervasives.tzresult Lwt.t

init params ~process_path launches an external process using process_path as the path for the executable. It also performs the handshake and sends the initialization parameters params to the process. At the end of the init function, the external process is ready to receive and answer requests.

val pid : t -> int

pid p returns the PID of the hypervisee process.

val send_request : t -> 'a P.request -> ('a * (Tezos_profiler.Profiler.report option * Tezos_profiler.Profiler.report option) option) Tezos_base.TzPervasives.tzresult Lwt.t

send_request p req sends the request req to the external process p, waits for the answer from the process and returns the result.

val reconfigure_event_logging : t -> Tezos_base.Internal_event_config.t -> unit Tezos_base.TzPervasives.tzresult Lwt.t

reconfigure_event_logging p config sends the request to the external process p to reconfigure the event logging system using the new configuration config.

val close : t -> unit Lwt.t

close p sends a termination request to the external process p and waits for p to stop.