Ir al contenido
Español

ScatterGatherOptionsType

Esta página aún no está disponible en tu idioma.

ScatterGatherOptionsType = object

Defined in: src/ScatterGatherOptions.ts:34

Plain options-object shape accepted by Router.scatterGatherFirstCompleted(...).

readonly optional timeoutMs?: number

Defined in: src/ScatterGatherOptions.ts:55

How long one scatter may run before it is given up on, in milliseconds. Default 4_500 — just under the 5_000 default ActorRef.ask uses, because that is literally what this becomes: the router turns each routee into an ask carrying this timeout, so the deadline is enforced per routee and the whole scatter fails only once the last one has expired. The gap is what lets the router report first; it used to match ask exactly, and the caller then saw its own timeout instead of the router’s (#1088).

Akka spells this within; the name here follows the project’s …Ms convention for durations and says what it actually is — the timeout handed to ask.

Sizing it is the whole point of the pattern: a hedged request wants a timeout shorter than the caller’s own, so a stalled replica costs a fraction of the caller’s budget rather than all of it. Set the caller’s ask timeout above this one, or the caller gives up before the router can report which routees failed.