-
Notifications
You must be signed in to change notification settings - Fork 87
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make everything async
#26
Conversation
This reverts commit fdef833.
Here we migrate from wrapping all upstream errors to exposing only select error variants to the downstream user. Also, we clean up and unify logging outputs.
} | ||
} | ||
|
||
pub(crate) fn set_runtime(&self, tokio_runtime: Arc<tokio::runtime::Runtime>) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I now have taken the approach of setting and dropping the runtime on start()
/stop()
. However, a probably cleaner alternative approach would be to use tokio::Runtime::enter
upon setup and just storing the EnterGuard
somewhere. However, this may result in panicking if we'd end up calling tokio::spawn
out-of-context. As I'm currently not 100% sure that this could never happen, I now went with this uglier approach for the time being, but will look into it again.
623116a
to
bac34b5
Compare
src/access.rs
Outdated
return fallback_fee; | ||
} | ||
|
||
locked_runtime.as_ref().unwrap().block_on(async { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As block_on
seems to have quite a few drawbacks even in the multithreaded runtime case I'll switch all of these to using spawn
+mspc
channels.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got rid of most of them, one non-trivial left for the moment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might be blocked on bitcoindevkit/bdk#795, otherwise we need to run all wallet operations in it's own thread and keep it block_on
.
bac34b5
to
ed49984
Compare
We migrate BDK and other remaining blocking parts to async.
ed49984
to
a6174dc
Compare
Closing as it became a requirement to already include this in #11. |
Based on #9, #10, #11.
We migrate BDK and other remaining blocking parts to async.