Skip to content

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.

new ActorSelection(system, pathSegments, pathString): ActorSelection

Defined in: src/ActorSelection.ts:16

ActorSystem

readonly string[]

Segments after /user/ or /system/, e.g. [‘user’, ‘foo’, ‘bar’].

string

Printable form, convenient for logging.

ActorSelection

readonly pathSegments: readonly string[]

Defined in: src/ActorSelection.ts:19

Segments after /user/ or /system/, e.g. [‘user’, ‘foo’, ‘bar’].


readonly pathString: string

Defined in: src/ActorSelection.ts:21

Printable form, convenient for logging.

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.

number = 1_000

Promise<ActorRef<unknown>>


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(...)).

unknown

ActorRef<unknown> | null

void


toString(): string

Defined in: src/ActorSelection.ts:51

string