콘텐츠로 이동
한국어

WebsocketConnection

이 콘텐츠는 아직 번역되지 않았습니다.

Defined in: src/http/websocket/WebsocketConnection.ts:31

Handle to an actor. The only way to interact with an actor — you never hold a direct reference to the Actor instance itself. tell() is fire-and- forget; ask() provides a request/response Promise.

TOut

readonly id: string

Defined in: src/http/websocket/WebsocketConnection.ts:33

Stable id, unique within the process (e.g. ws-7).


readonly isOpen: boolean

Defined in: src/http/websocket/WebsocketConnection.ts:43

true while the underlying socket is open.


abstract readonly path: ActorPath

Defined in: src/ActorRef.ts:58

ActorRef.path


readonly optional remoteAddress?: string

Defined in: src/http/websocket/WebsocketConnection.ts:35

Remote peer address, if the backend reported one.


readonly upgrade: WebsocketUpgradeInfo

Defined in: src/http/websocket/WebsocketConnection.ts:37

Snapshot of the HTTP upgrade request (path, params, query, headers).

ask<TResponse>(message, timeoutMs?): Promise<TResponse>

Defined in: src/ActorRef.ts:77

Request/response — send message and await the recipient’s reply. The framework synthesises a one-shot reply ref, injects it as both the sender slot and as message.replyTo, and resolves the returned promise with the first reply (or rejects with AskTimeoutError).

The caller never specifies replyTo on the message — the OmitReplyTo type subtracts it from the parameter type if the recipient declares it.

const value = await counter.ask<number>({ kind: 'get' });

TResponse = unknown

OmitReplyTo<TOut>

number = DEFAULT_ASK_TIMEOUT_MS

Promise<TResponse>

ActorRef.ask


close(code?, reason?): void

Defined in: src/http/websocket/WebsocketConnection.ts:41

Close this connection (1000 by default).

number

string

void


equals(other): boolean

Defined in: src/ActorRef.ts:104

ActorRef

boolean

ActorRef.equals


kill(): void

Defined in: src/ActorRef.ts:100

Kill this actor — raises ActorKilledError through the normal supervision path.

void

ActorRef.kill


send(message): void

Defined in: src/ActorRef.ts:64

Alias for tell — useful if you want to pipe something.

TOut

void

ActorRef.send


sendRaw(frame): void

Defined in: src/http/websocket/WebsocketConnection.ts:39

Send a raw frame, bypassing the codec.

WebsocketFrame

void


stop(): void

Defined in: src/ActorRef.ts:97

Gracefully stop this actor after it drains its mailbox.

void

ActorRef.stop


abstract tell(message, sender?): void

Defined in: src/ActorRef.ts:61

Send a message to this actor. sender is surfaced as context.sender in the recipient.

TOut

ActorRef<unknown> | null

void

ActorRef.tell


toString(): string

Defined in: src/ActorRef.ts:102

string

ActorRef.toString