BackoffSupervisorOptionsBuilder
Este conteúdo não está disponível em sua língua ainda.
Defined in: src/pattern/BackoffSupervisorOptions.ts:255
Fluent builder for BackoffSupervisorOptionsType:
const supervisorOptions = BackoffSupervisorOptions.create<FlakyMessage>() .withChild(Flaky) .withMinBackoff(200) .withMaxBackoff(10_000);Extends
Section titled “Extends”Type Parameters
Section titled “Type Parameters”T
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new BackoffSupervisorOptionsBuilder<
T>():BackoffSupervisorOptionsBuilder<T>
Returns
Section titled “Returns”BackoffSupervisorOptionsBuilder<T>
Inherited from
Section titled “Inherited from”Methods
Section titled “Methods”build()
Section titled “build()”build():
Partial<T>
Defined in: src/util/OptionsBuilder.ts:51
Snapshot the set fields as an independent Partial<T> (own props only).
Returns
Section titled “Returns”Partial<T>
Inherited from
Section titled “Inherited from”withChild()
Section titled “withChild()”withChild(
child):this
Defined in: src/pattern/BackoffSupervisorOptions.ts:262
The child actor — its class, or a factory when it needs dependencies.
Parameters
Section titled “Parameters”Returns
Section titled “Returns”this
withChildName()
Section titled “withChildName()”withChildName(
childName):this
Defined in: src/pattern/BackoffSupervisorOptions.ts:272
Name suffix for the child — the incarnation counter is appended.
Parameters
Section titled “Parameters”childName
Section titled “childName”string
Returns
Section titled “Returns”this
withChildOptions()
Section titled “withChildOptions()”withChildOptions(
childOptions):this
Defined in: src/pattern/BackoffSupervisorOptions.ts:267
Spawn options for the child; its supervision is fixed regardless.
Parameters
Section titled “Parameters”childOptions
Section titled “childOptions”ActorOptions<T>
Returns
Section titled “Returns”this
withClock()
Section titled “withClock()”withClock(
clock):this
Defined in: src/pattern/BackoffSupervisorOptions.ts:327
Override Date.now for deterministic tests.
Parameters
Section titled “Parameters”() => number
Returns
Section titled “Returns”this
withDrainGraceMs()
Section titled “withDrainGraceMs()”withDrainGraceMs(
drainGraceMs):this
Defined in: src/pattern/BackoffSupervisorOptions.ts:317
Grace period after a respawn before the stash drains, in ms, or 'auto' to derive it from minBackoff.
Parameters
Section titled “Parameters”drainGraceMs
Section titled “drainGraceMs”number | "auto"
Returns
Section titled “Returns”this
withForward()
Section titled “withForward()”withForward(
forward):this
Defined in: src/pattern/BackoffSupervisorOptions.ts:302
What to do with messages while the child is dead.
Parameters
Section titled “Parameters”forward
Section titled “forward”Returns
Section titled “Returns”this
withForwardDuringGrace()
Section titled “withForwardDuringGrace()”withForwardDuringGrace(
forwardDuringGrace):this
Defined in: src/pattern/BackoffSupervisorOptions.ts:322
Whether messages arriving inside the grace window forward immediately.
Parameters
Section titled “Parameters”forwardDuringGrace
Section titled “forwardDuringGrace”boolean
Returns
Section titled “Returns”this
withMaxBackoff()
Section titled “withMaxBackoff()”withMaxBackoff(
maxBackoff):this
Defined in: src/pattern/BackoffSupervisorOptions.ts:282
Ceiling for the backoff delay, in ms. Must be >= minBackoff.
Parameters
Section titled “Parameters”maxBackoff
Section titled “maxBackoff”number
Returns
Section titled “Returns”this
withMaxStashSize()
Section titled “withMaxStashSize()”withMaxStashSize(
maxStashSize):this
Defined in: src/pattern/BackoffSupervisorOptions.ts:312
Stash buffer size (only when forward === 'stash').
Parameters
Section titled “Parameters”maxStashSize
Section titled “maxStashSize”number
Returns
Section titled “Returns”this
withMinBackoff()
Section titled “withMinBackoff()”withMinBackoff(
minBackoff):this
Defined in: src/pattern/BackoffSupervisorOptions.ts:277
Floor for the backoff delay, in ms. Must be > 0.
Parameters
Section titled “Parameters”minBackoff
Section titled “minBackoff”number
Returns
Section titled “Returns”this
withPolicy()
Section titled “withPolicy()”withPolicy(
policy):this
Defined in: src/pattern/BackoffSupervisorOptions.ts:292
Custom policy — overrides the default exponential backoff.
Parameters
Section titled “Parameters”policy
Section titled “policy”Returns
Section titled “Returns”this
withRandomFactor()
Section titled “withRandomFactor()”withRandomFactor(
randomFactor):this
Defined in: src/pattern/BackoffSupervisorOptions.ts:287
Jitter fraction in [0, 1] — inert when a custom policy is set.
Parameters
Section titled “Parameters”randomFactor
Section titled “randomFactor”number
Returns
Section titled “Returns”this
withResetCounter()
Section titled “withResetCounter()”withResetCounter(
resetCounter):this
Defined in: src/pattern/BackoffSupervisorOptions.ts:297
Counter-reset rule.
Parameters
Section titled “Parameters”resetCounter
Section titled “resetCounter”Returns
Section titled “Returns”this
withTriggerOn()
Section titled “withTriggerOn()”withTriggerOn(
triggerOn):this
Defined in: src/pattern/BackoffSupervisorOptions.ts:307
Which terminations should trigger a respawn.
Parameters
Section titled “Parameters”triggerOn
Section titled “triggerOn”Returns
Section titled “Returns”this
create()
Section titled “create()”
staticcreate<T>():BackoffSupervisorOptionsBuilder<T>
Defined in: src/pattern/BackoffSupervisorOptions.ts:257
Start a fresh builder.
Type Parameters
Section titled “Type Parameters”T
Returns
Section titled “Returns”BackoffSupervisorOptionsBuilder<T>
