Optional
idOptional
logger?: LoggerOptional
middlewareMiddleware used to process the rpc messages.
The middlewareFactory needs to be a function that creates a pair of
transform streams that convert JSONRPCRequest
to Uint8Array
on the forward
path and Uint8Array
to JSONRPCResponse
on the reverse path.
An arrow function that when called, creates a new stream for each rpc method call.
Optional
timeoutTimeout time used if no timeout timer was provided when making a call. Defaults to 60,000 milliseconds. for a client call.
Optional
toProtected
callerProtected
idProtected
loggerReadonly
methodsProtected
middlewareProtected
Optional
onProtected
streamReadonly
timeoutProtected
toGeneric caller for Client streaming RPC calls. This returns a WritableStream for writing the input to and a Promise that resolves when the output is received. When finished the writable stream must be ended. Failing to do so will hold the connection open and result in a resource leak until the call times out.
Method name of the RPC call
ContextTimed used for timeouts and cancellation.
Generic caller for duplex RPC calls.
This returns a ReadableWritablePair
of the types specified. No validation
is applied to these types so make sure they match the types of the handler
you are calling.
When finished the streams must be ended manually. Failing to do so will
hold the connection open and result in a resource leak until the
call times out.
Method name of the RPC call
ContextTimed used for timeouts and cancellation.
Generic caller for raw RPC calls.
This returns a ReadableWritablePair
of the raw RPC stream.
When finished the streams must be ended manually. Failing to do so will
hold the connection open and result in a resource leak until the
call times out.
Raw streams don't support the keep alive timeout. Timeout will only apply
to the creation of the stream.
Method name of the RPC call
Parameters for the header message. The header is a single RPC message that is sent to specify the method for the RPC call. Any metadata of extra parameters is provided here.
ContextTimed used for timeouts and cancellation.
Generic caller for server streaming RPC calls. This returns a ReadableStream of the provided type. When finished, the readable needs to be cleaned up, otherwise cleanup happens mostly automatically.
Method name of the RPC call
Parameters to be provided with the RPC message. Matches the provided I type.
ContextTimed used for timeouts and cancellation.
Generic caller for unary RPC calls. This returns the response in the provided type. No validation is done so make sure the types match the handler types.
Method name of the RPC call
Parameters to be provided with the RPC message. Matches the provided I type.
ContextTimed used for timeouts and cancellation.
Generated using TypeDoc
Client manifest that defines the types for the rpc methods.