This repository was archived by the owner on Jan 22, 2025. It is now read-only.
JSON-RPC batching and request retries #2770
Labels
enhancement
New feature or request
question
Add this to close an issue with instructions on how to repost as a question on Stack Exchange
Motivation
I noticed in the library README for the experimental SDK that two of the motivations for the API design are:
However, it is somewhat rather unclear on how i.e. batching or retrying can be implemented with the current experimental SDK.
Example use case
I currently manually perform fetch calls myself to perform explicit batch JSON-RPC requests. This, however, is error-prone as it would require types and validation to be handled by myself (i.e. how do I handle the case that a response field overflows Number.MAX_SAFE_INTEGER?).
Details
Preliminarily, the only way I can imagine having such a granularity of level of options for retries/timeouts is to expose custom options on
.send()
. The custom options can be provided via theRpcTransport
interface.To support explicit batching, I can imagine a syntax i.e:
The batch method can either be directly exposed on top of the
Rpc
interface, or otherwise be provided as a separate exported helper that takes in aRpc
instance.The text was updated successfully, but these errors were encountered: