ParallelismOptionsBuilder
Dieser Inhalt ist noch nicht in deiner Sprache verfügbar.
Defined in: src/parallelism/ParallelismOptions.ts:82
Base class for the framework’s fluent options builders — the shared
mechanics behind MqttOptions, KafkaOptions, ActorSystemOptions,
and every other <X>Options builder.
Design (matches the hand-written MqttOptions that seeded this):
- Mutable,
this-returning. Each concretewithX(...)calls the protected set and returnsthis, so chaining stays typed as the concrete subclass across inheritance levels (no F-boundedSelfgeneric needed —thisalready IS the subclass). - A builder is its options. set writes each field as an
own enumerable property of the builder instance, so a builder is
structurally a bag of the fields you set. Consumers accept the
XOptionsunion (XOptionsBuilder | Partial<XOptionsType>) and read / spread the argument directly — no separate “resolve” step. ThewithX/buildmethods live on the prototype, so they never surface when the options are spread ({ ...options }), enumerated (Object.keys), or serialized (JSON.stringify): only the set fields do. (The consumer keeps the union in its signature because a builder — a methods-only type — is not assignable to a barePartial<T>: TypeScript’s weak-type check would reject it. Reading the options out of the argument is a plain cast:options as XOptionsType/{ ...(options as Partial<XOptionsType>) }.) build()snapshots. It returns an independentPartial<T>(a copy of the own fields) for the rare caller that wants to freeze a builder it intends to keep mutating; ordinary consumers don’t need it because they already read/spread the argument.- Feeds the existing resolution. Wherever HOCON is layered in — the
broker actors,
ClusterSharding.start— the options are the highest-precedence layer ofmergeOptions(defaults, HOCON, explicit); because a builder records ONLY the fields you set, unset fields fall through to HOCON — the builder never competes with config.
A builder instance is a throwaway construction helper: methods mutate in place, so a single instance is not a branch point (two chains off the same instance share state).
Extends
Section titled “Extends”Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new ParallelismOptionsBuilder():
ParallelismOptionsBuilder
Returns
Section titled “Returns”ParallelismOptionsBuilder
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”withBackend()
Section titled “withBackend()”withBackend(
backend):this
Defined in: src/parallelism/ParallelismOptions.ts:95
Parameters
Section titled “Parameters”backend
Section titled “backend”WorkerBackend
Returns
Section titled “Returns”this
withBootstrap()
Section titled “withBootstrap()”withBootstrap(
bootstrap):this
Defined in: src/parallelism/ParallelismOptions.ts:94
Parameters
Section titled “Parameters”bootstrap
Section titled “bootstrap”string | URL
Returns
Section titled “Returns”this
withBufferSize()
Section titled “withBufferSize()”withBufferSize(
bufferSize):this
Defined in: src/parallelism/ParallelismOptions.ts:93
Parameters
Section titled “Parameters”bufferSize
Section titled “bufferSize”number
Returns
Section titled “Returns”this
withLeader()
Section titled “withLeader()”withLeader(
leader):this
Defined in: src/parallelism/ParallelismOptions.ts:91
Parameters
Section titled “Parameters”leader
Section titled “leader”Returns
Section titled “Returns”this
withModule()
Section titled “withModule()”withModule(
module):this
Defined in: src/parallelism/ParallelismOptions.ts:88
Parameters
Section titled “Parameters”module
Section titled “module”string | URL | readonly (string | URL)[]
Returns
Section titled “Returns”this
withOffload()
Section titled “withOffload()”withOffload(
offload):this
Defined in: src/parallelism/ParallelismOptions.ts:89
Parameters
Section titled “Parameters”offload
Section titled “offload”readonly string[]
Returns
Section titled “Returns”this
withPlacement()
Section titled “withPlacement()”withPlacement(
placement):this
Defined in: src/parallelism/ParallelismOptions.ts:90
Parameters
Section titled “Parameters”placement
Section titled “placement”Returns
Section titled “Returns”this
withSpawnTimeoutMs()
Section titled “withSpawnTimeoutMs()”withSpawnTimeoutMs(
spawnTimeoutMs):this
Defined in: src/parallelism/ParallelismOptions.ts:92
Parameters
Section titled “Parameters”spawnTimeoutMs
Section titled “spawnTimeoutMs”number
Returns
Section titled “Returns”this
withWorkers()
Section titled “withWorkers()”withWorkers(
workers):this
Defined in: src/parallelism/ParallelismOptions.ts:87
Parameters
Section titled “Parameters”workers
Section titled “workers”number | "auto"
Returns
Section titled “Returns”this
create()
Section titled “create()”
staticcreate():ParallelismOptionsBuilder
Defined in: src/parallelism/ParallelismOptions.ts:83
Returns
Section titled “Returns”ParallelismOptionsBuilder
