pub trait WorkerHandle: Send + 'static {
// Required methods
fn pid(&self) -> u32;
fn send_task<'life0, 'async_trait>(
&'life0 mut self,
msg: RpcMessage,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn recv_task<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<Option<RpcMessage>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn send_control<'life0, 'async_trait>(
&'life0 mut self,
msg: RpcMessage,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn recv_control<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<Option<RpcMessage>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn terminate<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}Expand description
A handle to a spawned worker.
The pool sends task-channel frames via send_task and receives them via
recv_task. Control-channel frames travel through send_control and
recv_control. Termination is via terminate.
Required Methods§
Sourcefn send_task<'life0, 'async_trait>(
&'life0 mut self,
msg: RpcMessage,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn send_task<'life0, 'async_trait>(
&'life0 mut self,
msg: RpcMessage,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Send a frame on the task channel.
Sourcefn recv_task<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<Option<RpcMessage>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn recv_task<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<Option<RpcMessage>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Receive a frame from the task channel. Returns None on EOF.
Sourcefn send_control<'life0, 'async_trait>(
&'life0 mut self,
msg: RpcMessage,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn send_control<'life0, 'async_trait>(
&'life0 mut self,
msg: RpcMessage,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Send a frame on the control channel.
Sourcefn recv_control<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<Option<RpcMessage>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn recv_control<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<Option<RpcMessage>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Receive a frame from the control channel. Returns None on EOF.