ws-asyncapi API / core / OutboundRpc
Class: OutboundRpc
Defined in: .api-entries/core/index.d.ts:420
Outbound (server-initiated) RPC bookkeeping for a single connection.
The wire protocol is symmetric: the server can send a Frame.Request to a client and await its Frame.Reply/Frame.Error, exactly like a client does in the other direction. This holds the per-connection correlation counter + pending table for those server→client requests. One instance lives per connection (so a reply in a later message resolves the original promise).
Constructors
Constructor
new OutboundRpc():
OutboundRpc
Returns
OutboundRpc
Methods
request()
request(
send,name,input,timeout):Promise<unknown>
Defined in: .api-entries/core/index.d.ts:423
Send a request to the peer and resolve when its reply arrives.
Parameters
send
(frame) => void
name
string
input
unknown
timeout
number
Returns
Promise<unknown>
resolve()
resolve(
corrId,value):void
Defined in: .api-entries/core/index.d.ts:425
Resolve the pending request for corrId (on an inbound Reply).
Parameters
corrId
number
value
unknown
Returns
void
reject()
reject(
corrId,error):void
Defined in: .api-entries/core/index.d.ts:427
Reject the pending request for corrId (on an inbound Error).
Parameters
corrId
number
error
RpcError
Returns
void
rejectAll()
rejectAll(
error):void
Defined in: .api-entries/core/index.d.ts:429
Reject everything in flight (on disconnect).
Parameters
error
RpcError
Returns
void