ActorSelection
Defined in: src/ActorSelection.ts:15
A lookup handle for a logical actor path. Unlike ActorRef, which is a
direct handle to a known actor, an ActorSelection is a description of
where to look — resolving it walks the current actor tree (locally) or
issues a remote lookup.
For v1 we support exact paths only (no * wildcards). Messages tell()‘d
to a selection are delivered synchronously to the first matching actor if
it resolves immediately; otherwise they land in dead letters.
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new ActorSelection(
system,pathSegments,pathString):ActorSelection
Defined in: src/ActorSelection.ts:16
Parameters
Section titled “Parameters”system
Section titled “system”pathSegments
Section titled “pathSegments”readonly string[]
Segments after /user/ or /system/, e.g. [‘user’, ‘foo’, ‘bar’].
pathString
Section titled “pathString”string
Printable form, convenient for logging.
Returns
Section titled “Returns”ActorSelection
Properties
Section titled “Properties”pathSegments
Section titled “pathSegments”
readonlypathSegments: readonlystring[]
Defined in: src/ActorSelection.ts:19
Segments after /user/ or /system/, e.g. [‘user’, ‘foo’, ‘bar’].
pathString
Section titled “pathString”
readonlypathString:string
Defined in: src/ActorSelection.ts:21
Printable form, convenient for logging.
Methods
Section titled “Methods”resolveOne()
Section titled “resolveOne()”resolveOne(
timeoutMs?):Promise<ActorRef<unknown>>
Defined in: src/ActorSelection.ts:29
Resolve to a concrete ActorRef. Retries until timeoutMs elapses if
the intermediate cell is in the process of starting (so tests that race
spawn+selection are stable). Rejects with an Error on timeout.
Parameters
Section titled “Parameters”timeoutMs?
Section titled “timeoutMs?”number = 1_000
Returns
Section titled “Returns”Promise<ActorRef<unknown>>
tell()
Section titled “tell()”tell(
message,sender?):void
Defined in: src/ActorSelection.ts:45
Fire-and-forget: resolve immediately; if no match, drop to dead letters.
For cases where you want asynchronous retry, use resolveOne(...).then(r => r.tell(...)).
Parameters
Section titled “Parameters”message
Section titled “message”unknown
sender?
Section titled “sender?”ActorRef<unknown> | null
Returns
Section titled “Returns”void
toString()
Section titled “toString()”toString():
string
Defined in: src/ActorSelection.ts:51
Returns
Section titled “Returns”string