question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Implement retries into WS and HTTP RPC

See original GitHub issue

Right now, when we connect to WS(s) or HTTP(s) RPC, it only tries once. We should allow for retries before throwing completely.

Additionally, being able to retry the connection if we lose it would be helpful as well.

  • Implement a queueing wrapper around StreamingSocket with a non-blocking send function
  • Implement reconnects that send messages from the queue via the new connection as soon as established
  • Expose connected state (connecting, connected, disconnected) as a ValueAndUpdates field (Because we can. It is a fair API, but not strictly required for the product)
  • Make it possible for higher level applications to react to reconnects via a simple reconnected callback
  • Automatically reconnect on error/completion
  • Automatically re-subscribe in tendermint-rpc
  • Automatically re-subscribe in ethereum

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:8 (8 by maintainers)

github_iconTop GitHub Comments

2reactions
webmaster128commented, Jun 5, 2019

Good point @ethanfrey

To break this down into smaller steps, I suggest

  1. Implement a queueing wrapper around StreamingSocket with a non-blocking send function
  2. Implement reconnects that send messages from the queue via the new connection as soon as established
  3. Expose connected state (connecting, connected, disconnected) as a ValueAndUpdates field (Because we can. It is a fair API, but not strictly required for the product)
  4. Make it possible for higher level applications to react to reconnects via a simple reconnected callback
  5. Automatically re-subscribe in tendermint-rpc
  6. Automatically re-subscribe in ethereum
0reactions
ethanfreycommented, Jun 5, 2019

I agree with the above list. I think it still has some utility even in smaller chunks, maybe a series of PRs.

Read more comments on GitHub >

github_iconTop Results From Across the Web

WebSocket client - Retry - Ballerina language
Run the WebSocket service given in the Send/Receive message example. Run the client program by executing the command below.
Read more >
WebSocketProvider handle ws close and reconnect #1053
I use this code to detect ws close and reconn. ... fork / integrate that into ethers.js with the json-rpc specifics simply built...
Read more >
Top 5 async-retry Code Examples - Snyk
To help you get started, we've selected a few async-retry examples, based on popular ways it is used in public projects. Secure your...
Read more >
JSON RPC API - Solana Docs
JSON RPC API. Solana nodes accept HTTP requests using the JSON-RPC 2.0 specification. To interact with a Solana node inside a JavaScript application,...
Read more >
Comparing SOAP vs REST vs GraphQL vs RPC API - AltexSoft
In fact, some services are RESTful only to a degree. They have RPC style at the core, break down larger services into resources,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found