Skip to main content

Remote

Struct Remote 

pub struct Remote { /* private fields */ }
Expand description

A worker’s connection to a server, holding the shards’ lease.

Implementations§

§

impl Remote

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)

Delivers the messages hold_relay kept back, in the order they came, and lets later ones through.

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>

Like connect, with security given separately (the address then has no options).

pub fn connect_unix(path: &str) -> Result<Self>

pub fn shared_memory(&self) -> bool

Whether log sections and durable positions go through same-host shared memory instead of the socket.

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

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)

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>

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

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> ⓘ

Step limits held on the server (permits are leases).

pub fn take_calls(&self) -> Receiver<RelayedCall>

Calls other machines send through the server, for crate::client::serve_calls.

pub fn env(&self, shard: u32) -> RemoteEnv

Trait Implementations§

§

impl Clone for Remote

§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Auto Trait Implementations§

§

impl !RefUnwindSafe for Remote

§

impl !UnwindSafe for Remote

§

impl Forget for Remote

§

impl Freeze for Remote

§

impl Move for Remote

§

impl Send for Remote

§

impl Sync for Remote

§

impl Unpin for Remote

§

impl UnsafeUnpin for Remote

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.