JRPC Client pending requests
- [x] Client disposes
- [ ] Disconnects
At the moment there are two potential scenarios that can pending RPC requests that never finish.
Client is forced to dispose
Currently, if an instance of the JsonRpcClient is asked to dispose, it immediately closes the connection and completes all open BLOCKING requests with an error. All of the callback-based requests won't even get informed about the termination since there is no mechanism for that.
Solution:
Up on the call of ´dipose()´, wait for a given time for the pending requests to finish normally. In addition, deprecate the callback-based method!
Disconnects/reconnects
If for whatever reason the socket connection to the server closes, all pending requests will stay in the pending state forever, no matter if they use futures (BLOCKING) or callbacks.
Solution:
Again remove the callback method. Than cache the requests entirely in order to be able to resent them if the client is connected again. Alternatively, in case the connection closes, complete all pending futures/requests with an error!