Skip to main content

Worker

Struct Worker 

Source
pub struct Worker { /* private fields */ }
Expand description

A process that executes the slices it is sent.

Implementations§

Source§

impl Worker

Source

pub fn spawn(command: Command) -> Result<Self>

Starts the process and keeps its pipes. The worker there has to bring its own catalog; for an empty one, see Worker::carrying.

stderr is left inherited: its stdout is the wire.

Source

pub fn connect(addr: impl ToSocketAddrs) -> Result<Self>

Connects to a worker that was already running — the form that satisfies the use case. On the other side there is Serving::listen.

Source

pub fn carrying(self, artifact: Artifact, runtime: impl Into<String>) -> Self

The same worker, carrying what to provision it with if it started empty. runtimecpython-3.13/cloudpickle-3.1 — is what the far side’s Provision can reject at greeting time.

Source

pub fn offering( &self, artifact: Artifact, runtime: impl Into<String>, ) -> Result<(), TransportError>

The same on an already-built worker, for whoever decides at run time which nodes go to this host. Setting the same artifact twice does nothing; changing an open session’s fails.

Source

pub fn packing(self, codec: Arc<dyn Codec>) -> Self

The same worker, with somebody who knows how to write down what an opaque carries.

Without one, a value that only exists in this process is refused at encoding time. With one, it crosses as bytes and the refusal is left for what nobody registered a codec for.

Trait Implementations§

Source§

impl Drop for Worker

Source§

fn drop(&mut self)

Ends the conversation: a child gets its input closed and is waited for; a standing worker just loses the socket and awaits another client.

Source§

impl Transport for Worker

Source§

fn dispatch( &self, plan: &Plan, cargo: &Cargo<'_>, seen: Option<&dyn Watcher>, ) -> Result<Outcome, TransportError>

Executes plan over there, with what it needs in order to do so, and tells seen whatever the far side says while it is at it. Read more

Auto Trait Implementations§

§

impl !Freeze for Worker

§

impl !RefUnwindSafe for Worker

§

impl Send for Worker

§

impl Sync for Worker

§

impl Unpin for Worker

§

impl UnsafeUnpin for Worker

§

impl !UnwindSafe for Worker

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> 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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.