pub trait ReduceHandler<InputItem: Send + 'static, Reply: Send + 'static>: Actor {
// Required method
fn handle_reduce<'life0, 'life1, 'async_trait>(
&'life0 mut self,
receiver: StreamReceiver<InputItem>,
ctx: &'life1 mut ActorContext,
) -> Pin<Box<dyn Future<Output = Reply> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
}Expand description
Implemented by actors that handle reduce (client-streaming) requests.
The handler receives a StreamReceiver from which it pulls
caller-provided items. When the stream ends, the handler returns a
final reply.
Generic parameters:
InputItem— the type of items the caller streams to the actor.Reply— the type returned after the actor consumes all items.
Required Methods§
Sourcefn handle_reduce<'life0, 'life1, 'async_trait>(
&'life0 mut self,
receiver: StreamReceiver<InputItem>,
ctx: &'life1 mut ActorContext,
) -> Pin<Box<dyn Future<Output = Reply> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn handle_reduce<'life0, 'life1, 'async_trait>(
&'life0 mut self,
receiver: StreamReceiver<InputItem>,
ctx: &'life1 mut ActorContext,
) -> Pin<Box<dyn Future<Output = Reply> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Handle a reduce request. Pull items from receiver and return a reply.