I have added websocket disconnect reconnection and related close hook functions without changing the original architecture as much as possible; however, I have not tested it extensively and only tested it locally, and no problems have been found in the local tests for the time being.
when I subscribe to a new block, if the connection is disconnected, the new block header event may be lost before reconnecting and before re-initiating the subscription; I don't know if the subscription should be further processed to prevent data loss during reconnection.
I would like to understand if the idea of my code implementation makes sense.
I have added websocket disconnect reconnection and related close hook functions without changing the original architecture as much as possible; however, I have not tested it extensively and only tested it locally, and no problems have been found in the local tests for the time being.
when I subscribe to a new block, if the connection is disconnected, the new block header event may be lost before reconnecting and before re-initiating the subscription; I don't know if the subscription should be further processed to prevent data loss during reconnection.
I would like to understand if the idea of my code implementation makes sense.
https://github.com/litcc/rust-web3/commit/72f1aa19b9c7e81176437faa055149b42a2c5e87