Skip to main content

WorkerHandler

Trait WorkerHandler 

Source
pub trait WorkerHandler: Send + Sync {
    // Required method
    fn handle<'life0, 'async_trait>(
        &'life0 self,
        request: WorkerRequest,
    ) -> Pin<Box<dyn Future<Output = Result<Value, WorkerProtocolError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;

    // Provided method
    fn probe_health<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = WorkerHealthStatus> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait { ... }
}
Expand description

Host-implemented worker behavior for in-process worker pools.

Required Methods§

Source

fn handle<'life0, 'async_trait>( &'life0 self, request: WorkerRequest, ) -> Pin<Box<dyn Future<Output = Result<Value, WorkerProtocolError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Handles one worker protocol request.

Provided Methods§

Source

fn probe_health<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = WorkerHealthStatus> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Performs worker health probe.

Implementors§