ActorSystemOptionsBuilder
Defined in: src/ActorSystemOptions.ts:58
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”Type Parameters
Section titled “Type Parameters”T extends ActorSystemOptionsType = ActorSystemOptionsType
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new ActorSystemOptionsBuilder<
T>():ActorSystemOptionsBuilder<T>
Returns
Section titled “Returns”ActorSystemOptionsBuilder<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”withConfig()
Section titled “withConfig()”withConfig(
config):this
Defined in: src/ActorSystemOptions.ts:93
Application config — a prebuilt Config or a plain object of overrides.
Parameters
Section titled “Parameters”config
Section titled “config”Returns
Section titled “Returns”this
withConfigFile()
Section titled “withConfigFile()”withConfigFile(
configFile):this
Defined in: src/ActorSystemOptions.ts:98
Explicit path to application.conf (overrides ACTOR_TS_CONFIG + CWD lookup).
Parameters
Section titled “Parameters”configFile
Section titled “configFile”string
Returns
Section titled “Returns”this
withDispatcher()
Section titled “withDispatcher()”withDispatcher(
dispatcher):this
Defined in: src/ActorSystemOptions.ts:83
Custom dispatcher for the system’s default mailbox scheduling.
Parameters
Section titled “Parameters”dispatcher
Section titled “dispatcher”Returns
Section titled “Returns”this
withLogger()
Section titled “withLogger()”withLogger(
logger):this
Defined in: src/ActorSystemOptions.ts:73
System logger. Overrides the HOCON/console default.
Parameters
Section titled “Parameters”logger
Section titled “logger”Returns
Section titled “Returns”this
withLogLevel()
Section titled “withLogLevel()”withLogLevel(
logLevel):this
Defined in: src/ActorSystemOptions.ts:78
Minimum log level for the default console logger (ignored if withLogger is set).
Parameters
Section titled “Parameters”logLevel
Section titled “logLevel”Returns
Section titled “Returns”this
withPersistence()
Section titled “withPersistence()”withPersistence(
persistence):this
Defined in: src/ActorSystemOptions.ts:103
Wire a real journal / snapshot store at system creation time.
Parameters
Section titled “Parameters”persistence
Section titled “persistence”journal?
Section titled “journal?”snapshotStore?
Section titled “snapshotStore?”Returns
Section titled “Returns”this
withScheduler()
Section titled “withScheduler()”withScheduler(
scheduler):this
Defined in: src/ActorSystemOptions.ts:88
Custom scheduler — typically a ManualScheduler in tests.
Parameters
Section titled “Parameters”scheduler
Section titled “scheduler”Returns
Section titled “Returns”this
create()
Section titled “create()”
staticcreate():ActorSystemOptionsBuilder
Defined in: src/ActorSystemOptions.ts:60
Start a fresh builder. Equivalent to new ActorSystemOptionsBuilder().
Returns
Section titled “Returns”ActorSystemOptionsBuilder
