Struct Remote
pub struct Remote { /* private fields */ }Expand description
A worker’s connection to a server, holding the shards’ lease.
Implementations§
§impl Remote
impl Remote
pub fn hold_relay(&self)
pub fn hold_relay(&self)
Keeps messages relayed from other workers’ shards back until
release_relay, even from shards whose
thread runs: call it before Engine::open when the code is
registered after the engine opens. Otherwise a child start (or a
signal) that waited for this worker can reach its shard before its
type is registered, and fails as a type no code is registered for.
pub fn release_relay(&self)
pub fn release_relay(&self)
Delivers the messages hold_relay kept back,
in the order they came, and lets later ones through.
pub fn connect(addr: &str) -> Result<Self>
pub fn connect(addr: &str) -> Result<Self>
Connects and waits (as a standby, if another worker holds the lease)
until this worker holds every shard. addr is host:port,
unix:/path.sock or replicas://..., optionally followed by
connection options (?ca=...&token-file=..., see
Security::from_options).
pub fn connect_with(addr: &str, security: &Security) -> Result<Self>
pub fn connect_with(addr: &str, security: &Security) -> Result<Self>
Like connect, with security given separately
(the address then has no options).
pub fn connect_unix(path: &str) -> Result<Self>
Whether log sections and durable positions go through same-host shared memory instead of the socket.
pub fn invocation(&self) -> Option<u64>
pub fn invocation(&self) -> Option<u64>
The invocation this worker answers, if it is an invoked worker.
pub fn invocation_poll(&self, awaiting: &[String]) -> Progress
pub fn invocation_poll(&self, awaiting: &[String]) -> Progress
An invoked worker: whether to keep running (crate::invoke).
Asks every held shard what it has left to do, and drains once all
are idle. awaiting: workflow types the host has runs of and no
code for. Cheap; call it every few milliseconds until it says to
stop, then close the engine and call
finish_invocation.
pub fn finish_invocation(&self)
pub fn finish_invocation(&self)
An invoked worker leaves: reports each held shard’s next due time from its engine’s last report at close (shards whose engine did not close cleanly are left out, so the server treats them as crashed), then closes the connection. Idempotent.
pub fn shards(&self) -> u32
pub fn epoch(&self) -> u64
pub fn held_shards(&self) -> Vec<u32>
pub fn held_shards(&self) -> Vec<u32>
The shards this worker holds now. A server that leases shards one at a time grants more as other workers’ shards free up; the engine’s other shards wait as standbys until then.
pub fn store_round_trips(&self) -> u64
pub fn store_round_trips(&self) -> u64
Run-store reads this connection sent to the server. Reads that continue a sequential scan (a mass wake of parked runs) are mostly served from what earlier ones read ahead.
pub fn limits(&self) -> Arc<RemoteLimits> ⓘ
pub fn limits(&self) -> Arc<RemoteLimits> ⓘ
Step limits held on the server (permits are leases).
pub fn take_calls(&self) -> Receiver<RelayedCall>
pub fn take_calls(&self) -> Receiver<RelayedCall>
Calls other machines send through the server, for
crate::client::serve_calls.