-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Consider connecting once and keeping the connection #5
Comments
The python binding also reconnects for every request, so I'm not sure that this is possible. Also it would inherently serialize requests. |
Would serializing requests be a problem? |
Maybe? It could be useful to be able to have multiple requests in progress at once, especially if there would be an async API. Some commands ( |
That's a good point. It'd either had to be multiplexed somehow (if that's even possible) or handled from the outside. Alternatively, we could provide both APIs - the current one would be just a wrapper handling creating connection and calling appropriate request. |
A quick experiment (no error handling or reconnection whatsoever) shows that c-lightning can handle multiple successive requests over a connection, at least: https://github.com/laanwj/rust-clightning-rpc/tree/experiment |
Instead of connecting to the socket for every request connect only when the socket is created and use the same connection for subsequent requests. Admittedly, I don't know if this is supported by C-lightning, but I'd be highly surprised if not.
If retrying is desired, it might be handled by the client. There are already crates helping with this.
This might be related to #4.
The text was updated successfully, but these errors were encountered: