Expand description
Infrastructure for workers, which are agents that mostly communicate via mesh message passing. These provide a way for splitting up your program into separable components, each of which can optionally run in a separate process.
The primary entry points are the worker_host()
function, used to launch
workers, and the Worker
trait, used to define workers. The
register_workers
macro and the RegisteredWorkers
factory are helpful
for defining the possible workers in a binary.
Macros§
- register_
workers - Registers workers for use with
RegisteredWorkers
. - runnable_
workers - Generates a type that defines the set of workers that can be run by a worker host. Generate a type to that can be used to match a requested worker name and run it.
Structs§
- Registered
Workers - A worker factory that can build any worker built with
register_workers
. - Worker
Builder - A builder for a worker.
- Worker
Handle - Represents a running
Worker
instance providing the ability to restart, stop or wait for exit. To launch a worker and get a handle, useWorkerHost::launch_worker
- Worker
Host - A handle used to launch workers on a host.
- Worker
Host Runner - A runner returned by
worker_host()
. Used to handle worker launch requests. - Worker
Id - A unique identifier for a worker, used to specify which worker to launch.
Enums§
- Worker
Event - A lifetime event for a worker.
- Worker
Rpc - Common requests for workers.
Traits§
- Worker
- Trait implemented by workers.
- Worker
Factory - Trait implemented by a type that can dispatch requests to a worker.
Functions§
- launch_
local_ worker - Launches a worker locally.
- worker_
host - Returns a new
WorkerHost
,WorkerHostRunner
pair.