pub struct ActorFlow;Expand description
Collection of actor-aware stream flows.
Implementations§
Source§impl ActorFlow
impl ActorFlow
Sourcepub fn ask_with_status<In, Msg, Out, F>(
actor_ref: ActorRef<Msg>,
parallelism: usize,
timeout: Duration,
make_msg: F,
) -> Flow<In, Out, NotUsed>
pub fn ask_with_status<In, Msg, Out, F>( actor_ref: ActorRef<Msg>, parallelism: usize, timeout: Duration, make_msg: F, ) -> Flow<In, Out, NotUsed>
Sends each stream element to an actor and unwraps a status reply.
ActorStatus::Ok emits the wrapped value. ActorStatus::Err fails the
stream with that error.
Sourcepub fn ask_with_context<In, Ctx, Msg, Out, F>(
actor_ref: ActorRef<Msg>,
parallelism: usize,
timeout: Duration,
make_msg: F,
) -> FlowWithContext<In, Ctx, Out, Ctx, NotUsed>
pub fn ask_with_context<In, Ctx, Msg, Out, F>( actor_ref: ActorRef<Msg>, parallelism: usize, timeout: Duration, make_msg: F, ) -> FlowWithContext<In, Ctx, Out, Ctx, NotUsed>
Sends each (element, context) pair to an actor while preserving context.
The user message builder receives only the element and a reply port. The original context is reattached to the actor reply in-order.
Sourcepub fn ask_with_status_and_context<In, Ctx, Msg, Out, F>(
actor_ref: ActorRef<Msg>,
parallelism: usize,
timeout: Duration,
make_msg: F,
) -> FlowWithContext<In, Ctx, Out, Ctx, NotUsed>
pub fn ask_with_status_and_context<In, Ctx, Msg, Out, F>( actor_ref: ActorRef<Msg>, parallelism: usize, timeout: Duration, make_msg: F, ) -> FlowWithContext<In, Ctx, Out, Ctx, NotUsed>
Status-reply variant of ActorFlow::ask_with_context.
Sourcepub fn watch<T, Msg>(actor_ref: ActorRef<Msg>) -> Flow<T, T, NotUsed>
pub fn watch<T, Msg>(actor_ref: ActorRef<Msg>) -> Flow<T, T, NotUsed>
Fails a pass-through flow if actor_ref terminates while the stream is
being consumed.
This binds to Ractor’s monitor supervision events. Once the monitor sees
termination, the stream fails with StreamError::Failed and a
watched-actor termination message, even if upstream is idle.
Source§impl ActorFlow
impl ActorFlow
Sourcepub fn ask<In, Msg, Out, F>(
actor_ref: ActorRef<Msg>,
parallelism: usize,
timeout: Duration,
make_msg: F,
) -> Flow<In, Out, NotUsed>
pub fn ask<In, Msg, Out, F>( actor_ref: ActorRef<Msg>, parallelism: usize, timeout: Duration, make_msg: F, ) -> Flow<In, Out, NotUsed>
Sends each stream element to an actor using a request/reply message.
The returned flow preserves input order while allowing up to parallelism
requests in flight. It fails the stream if a request times out, the actor
cannot be sent to, or the reply port is dropped before a response arrives.