Pular para o conteúdo
Português (BR)

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);

T

new BackoffSupervisorOptionsBuilder<T>(): BackoffSupervisorOptionsBuilder<T>

BackoffSupervisorOptionsBuilder<T>

OptionsBuilder.constructor

build(): Partial<T>

Defined in: src/util/OptionsBuilder.ts:51

Snapshot the set fields as an independent Partial<T> (own props only).

Partial<T>

OptionsBuilder.build


withChild(child): this

Defined in: src/pattern/BackoffSupervisorOptions.ts:262

The child actor — its class, or a factory when it needs dependencies.

ActorClassOrFactory<T>

this


withChildName(childName): this

Defined in: src/pattern/BackoffSupervisorOptions.ts:272

Name suffix for the child — the incarnation counter is appended.

string

this


withChildOptions(childOptions): this

Defined in: src/pattern/BackoffSupervisorOptions.ts:267

Spawn options for the child; its supervision is fixed regardless.

ActorOptions<T>

this


withClock(clock): this

Defined in: src/pattern/BackoffSupervisorOptions.ts:327

Override Date.now for deterministic tests.

() => number

this


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.

number | "auto"

this


withForward(forward): this

Defined in: src/pattern/BackoffSupervisorOptions.ts:302

What to do with messages while the child is dead.

ForwardStrategy

this


withForwardDuringGrace(forwardDuringGrace): this

Defined in: src/pattern/BackoffSupervisorOptions.ts:322

Whether messages arriving inside the grace window forward immediately.

boolean

this


withMaxBackoff(maxBackoff): this

Defined in: src/pattern/BackoffSupervisorOptions.ts:282

Ceiling for the backoff delay, in ms. Must be >= minBackoff.

number

this


withMaxStashSize(maxStashSize): this

Defined in: src/pattern/BackoffSupervisorOptions.ts:312

Stash buffer size (only when forward === 'stash').

number

this


withMinBackoff(minBackoff): this

Defined in: src/pattern/BackoffSupervisorOptions.ts:277

Floor for the backoff delay, in ms. Must be > 0.

number

this


withPolicy(policy): this

Defined in: src/pattern/BackoffSupervisorOptions.ts:292

Custom policy — overrides the default exponential backoff.

BackoffPolicy

this


withRandomFactor(randomFactor): this

Defined in: src/pattern/BackoffSupervisorOptions.ts:287

Jitter fraction in [0, 1] — inert when a custom policy is set.

number

this


withResetCounter(resetCounter): this

Defined in: src/pattern/BackoffSupervisorOptions.ts:297

Counter-reset rule.

ResetCounter

this


withTriggerOn(triggerOn): this

Defined in: src/pattern/BackoffSupervisorOptions.ts:307

Which terminations should trigger a respawn.

TerminationTrigger

this


static create<T>(): BackoffSupervisorOptionsBuilder<T>

Defined in: src/pattern/BackoffSupervisorOptions.ts:257

Start a fresh builder.

T

BackoffSupervisorOptionsBuilder<T>