Open mikedilger opened 3 months ago
We cannot pass non-Send things across .await
points so the interaction of async and RwTxn
/RoTxn
becomes unworkable.
Therefore we probably need to make a single thread which handles actual storage read/writes, and which holds the only single write transaction, and which we communicate with through messaging from the various async task threads that tokio manages. Huge. Bigly.
Ok turns out we can make RwTxn / RoTxn Send
by turning on a heed feature. Whew. That solves part of the problem.
For Nip46 client support we are making Signer functions async (since the network is slow). This forces massive amounts of other code that wasn't already async to be async. But in many places we cheated using
runtime.block_on()
orblocking_read()
orblocking_write()
.Perhaps we should just make a lot more of the code async.