create_rpc ?name ~f ~bin_input ~bin_output ()
will create an Rpc.Rpc.t
with
name
if specified and use f
as an implementation for this Rpc. It returns back a
Function.t
, a type-safe Rpc.Rpc.t
.
create_pipe ?name ~f ~bin_input ~bin_output ()
will create an Rpc.Pipe_rpc.t
with name
if specified. The implementation for this Rpc is a function that creates
a Pipe.Reader.t
and a Pipe.Writer.t
, then calls f arg ~writer
and returns the
reader. create_pipe
returns a Function_piped.t
which is a type-safe
Rpc.Pipe_rpc.t
.
of_async_rpc ~f rpc
is the analog to create_rpc
but instead of creating an Rpc
protocol, it uses the supplied one
of_async_pipe_rpc ~f rpc
is the analog to create_pipe
but instead of creating a
Pipe_rpc protocol, it uses the supplied one
run
is exposed in this interface so the implementations of functions can include
running other functions defined on this worker. A function can take a worker
as an
argument and call run
on this worker