package command_rpc

  1. Overview
  2. Docs
type t
type 'a with_connection_args = ?wait_for_stderr_transfer:bool -> ?connection_description:Core.Info.t -> ?handshake_timeout:Core.Time.Span.t -> ?heartbeat_config:Async.Rpc.Connection.Heartbeat_config.t -> ?max_message_size:int -> ?implementations:unit Async.Rpc.Implementations.t -> ?propagate_stderr:bool -> ?env:Async.Process.env -> ?process_create: (prog:string -> args:string list -> ?env:Async.Process.env -> ?working_dir:string -> unit -> Async.Process.t Async.Deferred.Or_error.t) -> ?working_dir:string -> prog:string -> args:string list -> 'a

create spawns a child process and returns an RPC connection that operates on the child's stdin and stdout. The child will be killed and reaped when the connection is closed. If propagate_stderr is true, the child's stderr will be printed on the parent's stderr; otherwise it will be ignored.

with_close spawns a child and connects like create, then calls the function passed in on the resulting connection. Like Rpc.Connection.with_close, if implementations is passed, with_close will not return until the connection is closed by either the parent or the child; otherwise, it closes the connection and kills the child when the provided function returns.

val rpc_connection : t -> Async.Rpc.Connection.t

Get the RPC connection needed to talk to the command-rpc executable.

module Expert : sig ... end

This module exists for testing purposes only. For example, clients can test whether their command-rpc server cleans up after itself properly when a ctrl-c at the command line kills a whole process group, server included.

OCaml

Innovation. Community. Security.