package rpc_parallel

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type
type t
val sexp_of_t : t -> Ppx_sexp_conv_lib.Sexp.t
type unmanaged_t
type 'a functions
val functions : unmanaged_t functions

Accessor for the functions implemented by this worker type

type worker_state_init_arg
type connection_state_init_arg
val id : t -> Id.t
val spawn : ?how:How_to_run.t -> ?name:string -> ?env:(string * string) list -> ?connection_timeout:Core.Time.Span.t -> ?cd:string -> ?umask:int -> redirect_stdout:Fd_redirection.t -> redirect_stderr:Fd_redirection.t -> worker_state_init_arg -> connection_state_init_arg -> on_failure:(Core.Error.t -> unit) -> on_connection_to_worker_closed:(Core.Error.t -> unit) -> t Core.Or_error.t Async.Deferred.t
val spawn_exn : ?how:How_to_run.t -> ?name:string -> ?env:(string * string) list -> ?connection_timeout:Core.Time.Span.t -> ?cd:string -> ?umask:int -> redirect_stdout:Fd_redirection.t -> redirect_stderr:Fd_redirection.t -> worker_state_init_arg -> connection_state_init_arg -> on_failure:(Core.Error.t -> unit) -> on_connection_to_worker_closed:(Core.Error.t -> unit) -> t Async.Deferred.t
val run : t -> f:(unmanaged_t, 'query, 'response) Parallel.Function.t -> arg:'query -> 'response Core.Or_error.t Async.Deferred.t

run t and run_exn t will connect to t if there is not already a connection, but if there is currently a connection that has gone stale, they will fail with an error. Trying again will attempt a reconnection.

val run_exn : t -> f:(unmanaged_t, 'query, 'response) Parallel.Function.t -> arg:'query -> 'response Async.Deferred.t

Using these functions will not result in on_failure reporting a closed connection, unlike running the shutdown function.

val kill_exn : t -> unit Async.Deferred.t