ParallelismExtension
이 콘텐츠는 아직 번역되지 않았습니다.
Defined in: src/parallelism/ParallelismExtension.ts:84
Actors on worker threads from configuration alone (#1563).
actor-ts.parallelism.workers above zero makes ActorSystem.create start a
WorkerMesh in the background and turns system.spawn into a placement
decision: an actor whose path matches offload is created on a worker,
every other one where it always was. The application does not change —
the same spawn(MyActor, 'x') returns an ActorRef that tells, asks
and watches across the thread, and ref.path is the path it would have
had at home — and workers = 0, the default, is the untouched code path:
no mesh, no import, one null check.
What cannot be hidden is said loudly instead of silently: the factory form
of spawn is a closure and cannot cross a thread; a class has to be
exported from the actor module for both sides to name it; and /system is
never a placement target (see ParallelismOptionsValidator). Children
stay with their parent, so the unit of offload is the subtree.
Implements
Section titled “Implements”Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new ParallelismExtension(
system,explicitOptions):ParallelismExtension
Defined in: src/parallelism/ParallelismExtension.ts:106
Parameters
Section titled “Parameters”system
Section titled “system”explicitOptions
Section titled “explicitOptions”ParallelismOptionsType | undefined
Returns
Section titled “Returns”ParallelismExtension
Properties
Section titled “Properties”enabled
Section titled “enabled”
readonlyenabled:boolean
Defined in: src/parallelism/ParallelismExtension.ts:86
false when workers = 0: the extension exists, and does nothing.
Accessors
Section titled “Accessors”exportedActors
Section titled “exportedActors”Get Signature
Section titled “Get Signature”get exportedActors(): readonly
string[]
Defined in: src/parallelism/ParallelismExtension.ts:149
The export names the main thread will offload, once the modules are loaded.
Returns
Section titled “Returns”readonly string[]
workerMesh
Section titled “workerMesh”Get Signature
Section titled “Get Signature”get workerMesh():
WorkerMesh|null
Defined in: src/parallelism/ParallelismExtension.ts:146
The mesh, once it is up.
Returns
Section titled “Returns”WorkerMesh | null
Methods
Section titled “Methods”whenReady()
Section titled “whenReady()”whenReady():
Promise<void>
Defined in: src/parallelism/ParallelismExtension.ts:141
Resolves once the mesh is up and the actor modules are registered; rejects with what stopped it.
Returns
Section titled “Returns”Promise<void>
