ask
Use the “Ask Pattern” to send a request-reply message to the target ref
actor (of the classic actors API).
Signature
Source.ask
Source.ask
Flow.ask
Flow.ask
Description
Use the Ask Pattern to send a request-reply message to the target ref
actor. If any of the asks times out it will fail the stream with a AskTimeoutException
AskTimeoutException
.
The mapTo
classS
generic parameter is used to cast the responses from the actor to the expected outgoing flow type.
Similar to the plain ask pattern, the target actor is allowed to reply with Status
Status
. An Status.Failure
Status.Failure
will cause the operator to fail with the cause carried in the Failure
message.
Adheres to the ActorAttributes.SupervisionStrategy
ActorAttributes.SupervisionStrategy
attribute.
See also:
- ActorFlow.ask for the
org.apache.pekko.actor.typed.ActorRef[_]
variant
Reactive Streams semantics
emits when the ask Future
CompletionStage
returned by the provided function finishes for the next element in sequence
backpressures when the number of ask Future
s CompletionStage
s reaches the configured parallelism and the downstream backpressures
completes when upstream completes and all ask Future
s CompletionStage
s has been completed and all elements has been emitted