-
Notifications
You must be signed in to change notification settings - Fork 405
Async KV Store #3778
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
base: main
Are you sure you want to change the base?
Async KV Store #3778
Conversation
Async closures are complicated. Preparatory commit.
Convert methods that need to be async when the wallet traits become async.
It seems that the compiler doesn't recognize the drop and complains that the mutex crosses an await (introduced in later commit), even though it doesn't.
Async closures are complicated. Preparatory commit.
Changes the CoinSelectionSource and WalletSource traits to be async and provides WalletSourceSyncWrapper to as a helper for users that want to implement a sync wallet source. TestWalletSource is kept sync, to prevent a cascade of async conversions in tests.
👋 Hi! I see this is a draft PR. |
391ffb1
to
faa071d
Compare
Poll::Pending => { | ||
println!("Future not ready, using tokio runtime"); | ||
|
||
self.runtime.spawn(async move { |
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.
This doesn't need to be tokio, it could be a generic spawn method too of course.
|
||
match fut.as_mut().poll(&mut cx) { | ||
Poll::Ready(_) => { | ||
UpdateStatus::Completed |
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.
This initiates the stable persistence flow in LDK.
Draft PR for discussion on approach
Relates to #1470