Skip to main content

ActionOffload

Trait ActionOffload 

pub trait ActionOffload: Send + Sync {
    // Required method
    fn offload(
        &self,
        request: OffloadRequest,
    ) -> Pin<Box<dyn Future<Output = Offloaded> + Send + '_>>;

    // Provided methods
    fn offload_invocation(
        &self,
        request: OffloadRequest,
        invocation: InvokeRequest,
    ) -> Pin<Box<dyn Future<Output = Offloaded> + Send + '_>> { ... }
    fn ran_here(&self, request: &OffloadRequest, elapsed: Duration) { ... }
}
Expand description

The device’s route for offloadable invocations.

Required Methods§

fn offload( &self, request: OffloadRequest, ) -> Pin<Box<dyn Future<Output = Offloaded> + Send + '_>>

Run request on the best-placed other device, or say why it should run here.

Provided Methods§

fn offload_invocation( &self, request: OffloadRequest, invocation: InvokeRequest, ) -> Pin<Box<dyn Future<Output = Offloaded> + Send + '_>>

Self::offload for the invocation request was admitted from, as this device’s door would send it to another device: a route that runs it elsewhere sends the invocation the person made, so the device that runs it answers that one and a retry there is not a second run. A route with no device to send it to keeps its own way of running it.

fn ran_here(&self, request: &OffloadRequest, elapsed: Duration)

The app’s handler ran request here in elapsed: what placement weighs moving its inputs against next time.

Implementors§