-
Notifications
You must be signed in to change notification settings - Fork 23
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
Refactor away Mutex around BDK #730
Comments
Can you elaborate how this can help? I don't see it yet. This is my understanding of what you are trying: Create a wallet actor: Another This means, Isn't this the same situation what we have right now? |
Not quite. We already figured out a way to do this in ItchySats, see Thomas' comment here. It's only a workaround until we can upgrade to latest |
my apologies, I missed this comment yesterday. additional advantages:
yes, apparently |
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days. |
I think we can close this because we should just update to LDK v0.0.116 and see what design is most desirable. |
Technically we had one issue I think - need to ensure that CPU-bound tasks (e.g wallet sync) aren't done on the tokio reactor. Not sure if still applies but might be relevant. |
Absolutely, great point! Although I think there should be ways to still follow the actor pattern with Funnily enough, I proposed a PR for this at some point and I was making the mistake you highlight here. |
Yep, sounds good! |
It's a huge problem that we can block the whole app because other part is waiting for the Mutex to be unlocked.
Moving the BDK wallet inside an entity that communicates with other threads via channel can avoid this situation. This is essentially the "actor" pattern.
This is what we've done in ItchySats, and we never had a problem with BDK there.
note: There might not be a need to introduce a whole framework to deal with it, it might be enough to hand-craft it: https://ryhl.io/blog/actors-with-tokio/
The text was updated successfully, but these errors were encountered: