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§
Sourcefn 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,
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§
Sourcefn probe_health<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = WorkerHealthStatus> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
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.