Up

Module Connection

Signature

type t
val run : t -> f:(worker, 'query, 'response) Function.t -> arg:'query -> 'response Core.Std.Or_error.t Async.Std.Deferred.t

Run functions implemented by this worker

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

Connect to a given worker, returning a type wrapped Rpc.Connection.t that can be used to run functions.

with_client worker init_arg f connects to the worker's server, initializes the connection state with init_arg and runs f until an exception is thrown or until the returned Deferred is determined.

NOTE: You should be careful when using this with Pipe_rpc. See Rpc.Connection.with_close for more information.

val close : t -> unit Async.Std.Deferred.t
val close_finished : t -> unit Async.Std.Deferred.t
val is_closed : t -> bool