WebsocketConnection
Este conteúdo não está disponível em sua língua ainda.
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.
Extends
Section titled “Extends”ActorRef<TOut>
Type Parameters
Section titled “Type Parameters”TOut
Properties
Section titled “Properties”
readonlyid:string
Defined in: src/http/websocket/WebsocketConnection.ts:33
Stable id, unique within the process (e.g. ws-7).
isOpen
Section titled “isOpen”
readonlyisOpen:boolean
Defined in: src/http/websocket/WebsocketConnection.ts:43
true while the underlying socket is open.
abstractreadonlypath:ActorPath
Defined in: src/ActorRef.ts:58
Inherited from
Section titled “Inherited from”remoteAddress?
Section titled “remoteAddress?”
readonlyoptionalremoteAddress?:string
Defined in: src/http/websocket/WebsocketConnection.ts:35
Remote peer address, if the backend reported one.
upgrade
Section titled “upgrade”
readonlyupgrade:WebsocketUpgradeInfo
Defined in: src/http/websocket/WebsocketConnection.ts:37
Snapshot of the HTTP upgrade request (path, params, query, headers).
Methods
Section titled “Methods”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' });Type Parameters
Section titled “Type Parameters”TResponse
Section titled “TResponse”TResponse = unknown
Parameters
Section titled “Parameters”message
Section titled “message”OmitReplyTo<TOut>
timeoutMs?
Section titled “timeoutMs?”number = DEFAULT_ASK_TIMEOUT_MS
Returns
Section titled “Returns”Promise<TResponse>
Inherited from
Section titled “Inherited from”close()
Section titled “close()”close(
code?,reason?):void
Defined in: src/http/websocket/WebsocketConnection.ts:41
Close this connection (1000 by default).
Parameters
Section titled “Parameters”number
reason?
Section titled “reason?”string
Returns
Section titled “Returns”void
equals()
Section titled “equals()”equals(
other):boolean
Defined in: src/ActorRef.ts:104
Parameters
Section titled “Parameters”Returns
Section titled “Returns”boolean
Inherited from
Section titled “Inherited from”kill()
Section titled “kill()”kill():
void
Defined in: src/ActorRef.ts:100
Kill this actor — raises ActorKilledError through the normal supervision path.
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”send()
Section titled “send()”send(
message):void
Defined in: src/ActorRef.ts:64
Alias for tell — useful if you want to pipe something.
Parameters
Section titled “Parameters”message
Section titled “message”TOut
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”sendRaw()
Section titled “sendRaw()”sendRaw(
frame):void
Defined in: src/http/websocket/WebsocketConnection.ts:39
Send a raw frame, bypassing the codec.
Parameters
Section titled “Parameters”Returns
Section titled “Returns”void
stop()
Section titled “stop()”stop():
void
Defined in: src/ActorRef.ts:97
Gracefully stop this actor after it drains its mailbox.
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”tell()
Section titled “tell()”
abstracttell(message,sender?):void
Defined in: src/ActorRef.ts:61
Send a message to this actor. sender is surfaced as context.sender in the recipient.
Parameters
Section titled “Parameters”message
Section titled “message”TOut
sender?
Section titled “sender?”ActorRef<unknown> | null
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”toString()
Section titled “toString()”toString():
string
Defined in: src/ActorRef.ts:102
Returns
Section titled “Returns”string
