A major source of cascading async functions in the library is the send and recv calls. Which were made async for historical reason, but they don't need to be async.
Turning these two function into regular blocking functions will simplify the runtimes as well as will make many other higher level functions non-async too.
Similarly the read_rpc_message function can be blocking too.
A major source of cascading
async
functions in the library is thesend
andrecv
calls. Which were made async for historical reason, but they don't need to be async.https://github.com/citadel-tech/coinswap/blob/a85c9a33cc56619a6c55d35ede2cab0c7f36aa81/src/utill.rs#L175-L195
Turning these two function into regular blocking functions will simplify the runtimes as well as will make many other higher level functions non-async too.
Similarly the read_rpc_message function can be blocking too.
https://github.com/citadel-tech/coinswap/blob/a85c9a33cc56619a6c55d35ede2cab0c7f36aa81/src/maker/rpc/server.rs#L15-L35
This will probably allow us to make the
start_rpc_server
method blocking and we can spawn a blocking thread to handle it.