This PR attempts to remove tokio from the whole crate and makes all code blocking. This simplifies the code structure and makes the internal thread pool management more visible.
Tokio has been a historical dependency of the crate, and provided little benefit, as the Maker server maxes out at 5 fixed and one thread per swap peer. So tokio was an over-engineering.
Benefits of these changes:
Easier server code at Maker.
Blocking communication flow. Ensures we only move through the protocol in a strict sequence.
Unified send/recv util method. Used for Taker/Maker for both server-side and RPC-APP communication.
Avoid weird thread lock situations and easier debug flow.
There's a lot changed here (almost everything). So take your time reviewing.
Suggestion for Reveiwers.
The change set is huge, so don't try triaging each file.
Major changes are in Maker, Taker, and DNS refactoring commits.
Take a look at some example replacements of select! macros and suggest more idiomatic alternatives.
Search for TODOs in the code for ideas on further fixes via future PRs.
Fixes #185 #214
Summary
This PR attempts to remove tokio from the whole crate and makes all code blocking. This simplifies the code structure and makes the internal thread pool management more visible.
Tokio has been a historical dependency of the crate, and provided little benefit, as the Maker server maxes out at 5 fixed and one thread per swap peer. So tokio was an over-engineering.
Benefits of these changes:
There's a lot changed here (almost everything). So take your time reviewing.
Suggestion for Reveiwers.
select!
macros and suggest more idiomatic alternatives.