The current approach of having a thread for blockchain parsing and another thread for network message dispatcher (which has no overhead) is not the best architecture. We can use the same thread for step-execution of blockchain and network. This will provide use a more functional approach.
- We can split the blockchain step in two steps: the process_net_message and the handle_sync.
- We can remove the queues, using step result as request/response list (so we don't need a threadsafe queue, and the functional thread will result more clear).
https://github.com/dakk/caravand/tree/single-thread
Minors
- Avoid reconnecting to the same not-available node
- Handle shutdown
The current approach of having a thread for blockchain parsing and another thread for network message dispatcher (which has no overhead) is not the best architecture. We can use the same thread for step-execution of blockchain and network. This will provide use a more functional approach.
https://github.com/dakk/caravand/tree/single-thread
Minors