Timeout is the Akka value that sets how long an actor will wait for a reply when using the ask pattern. An ask has two outcomes: a reply arrives in time and is handled as Success, or no timely reply arrives and is handled as Failure. section 3.2 section 3.4
Set a timeout wherever an ask needs a response deadline. In Scala, `Timeout(3, SECONDS)` can be supplied to `context.ask`; the ask signature accepts it as the implicit `responseTimeout` argument, so an implicit value in scope can be selected automatically. section 3.2.4 section 3.2.7
Parsing worker with a three-second deadline
A manager creates a worker, asks it to parse text, and maps `Success(Worker.Done)` to a successful report and `Failure(ex)` to a failure report. With a three-second timeout, a worker that finishes too late can still complete its work, but its response is no longer useful to the asking workflow. section 3.2.4 section 3.2.1
A timeout does not establish reliable delivery or cancel the worker’s work. The ask uses an ephemeral proxy actor as the reply target; when its time expires, it reports an error and stops. A later worker reply can then be forwarded to dead letters. Sending to dead letters is best effort with at-most-once delivery. section 3.2.1
The diagram shows the short-lived intermediate actor that receives the worker reply, times out the ask, and stops before a late reply can arrive. section 3.2.1
When choosing and handling a timeout:
- Treat it as the maximum wait for the response, not as proof that the worker stopped or failed. section 3.2 section 3.2.1
- Handle both `Success` and `Failure` in the response callback, producing a message the manager can process. section 3.2.4 section 3.2.7
- Expect a timeout when a recipient does not send a reply, including when worker execution prevents a response. section 3.2.1








