module Worker = Make(T)
The Worker
module has specialized functions to spawn workers and run functions on
workers.
A Worker.t
type is defined with bin_io
so it is possible to create functions
that take a worker as an argument.
A type alias to make the Connection
and Managed
signature more readable
serve arg
will start an Rpc server in process implementing all the functions
of the given worker.
spawn init_arg ?where ?on_failure ()
will create a worker on where
that can subsequently run some functions.
where
defaults to `Local
but can be specified to be some remote host.
cd
defaults to / and can be used to change the current working directory of a
spawned worker.
on_failure exn
will be called inside Monitor.current ()
at the time of the call
to spawn
in the master when the spawned worker raises a background exception.
All exceptions raised before function return will be returned to the caller.
worker_state_init_arg
will be passed to Worker_state.init
of the given Worker_spec
module. This initializes a persistent worker state for all connections to this
worker.