Skip to content

Single thread for blockchain and network dispatcher #84

Description

@dakk

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions