async-call-rpc

A lightweight JSON RPC client & server

Home > async-call-rpc > AsyncCallOptions

AsyncCallOptions interface

Options for AsyncCall()

Signature:

export interface AsyncCallOptions<EncodedRequest = unknown, EncodedResponse = unknown> 

Properties

Property Modifiers Type Description
channel   CallbackBasedChannel<EncodedRequest | EncodedResponse> | EventBasedChannel<EncodedRequest | EncodedResponse> | Promise<CallbackBasedChannel<EncodedRequest | EncodedResponse> | EventBasedChannel<EncodedRequest | EncodedResponse>> The message channel to exchange messages between server and client
encoder?   IsomorphicEncoder<EncodedRequest, EncodedResponse> | IsomorphicEncoderFull<EncodedRequest, EncodedResponse> (Optional) Encoder of requests and responses.
forceSignal?   AbortSignalLike (Optional) AbortSignal to force stop the instance.
key?   string (Optional) Name used when pretty log is enabled.
log?   AsyncCallLogLevel | boolean | ‘all’ (Optional) Choose log level.
logger?   ConsoleInterface (Optional) Provide the logger
mapError?   ErrorMapFunction<unknown> (Optional) Change the ErrorResponseDetail.
name?   string (Optional) Name used when pretty log is enabled.
parameterStructure?   ‘by-position’ | ‘by-name’ (Optional) Choose flavor of parameter structures defined in the spec
parameterStructures?   ‘by-position’ | ‘by-name’ (Optional) Choose flavor of parameter structures defined in the spec
preferLocalImplementation?   boolean (Optional) Prefer local implementation than remote.
serializer?   Serialization (Optional) Serializer of the requests and responses.
signal?   AbortSignalLike (Optional) AbortSignal to stop the instance.
strict?   AsyncCallStrictJSONRPC | boolean (Optional) Control the behavior that different from the JSON-RPC spec
thenable?   boolean (Optional) If the instance is “thenable”.

Methods

Method Description
idGenerator()? (Optional) The ID generator of each JSON RPC request