clio
clio copied to clipboard
refactor forwardToRippled()
Currently, we just connect a new socket every time. We should refactor how this works to maintain a websocket connection.
We should maintain a pool of sockets, and acquire one per request. Or we can maintain a list of IDs and only maintain one connection to each p2p node.
Do we need to make this change given your async changes?
This is a potential improvement that might come with some side-effects however. Rippled might close the websocket if it's open for long and unused. We need to measure if this even helps at all with performance. Also this is depending on the ETLSource being used, which means that the websocket need to be alive for each and every ETLSource that is configured. Plus all the problems described in #51
In boost asio websocket connection should work on a strand so it will be quite complicated to implement this. We decided that optimisation we would gain from this doesn't worth it. Instead we could switch http requests #1180.