-
Notifications
You must be signed in to change notification settings - Fork 251
buffered provider #1149
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
buffered provider #1149
Conversation
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.
Notes for myself
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 think this is OK. Have a couple of questions.
edc0d36
to
450daee
Compare
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.
LGTM
* provider: ResettableKeyStore * keystore: remove mutex * use datastore namespace * don't sync to write to altDs * simplify put * deduplicate operation execution code * buffered provider * tests * removing redundant code * docs * wait on empty queue * fix flaky test
* provider: ResettableKeyStore * keystore: remove mutex * use datastore namespace * don't sync to write to altDs * simplify put * deduplicate operation execution code * buffered provider * tests * removing redundant code * docs * wait on empty queue * fix flaky test
* provider: ResettableKeyStore * keystore: remove mutex * use datastore namespace * don't sync to write to altDs * simplify put * deduplicate operation execution code * buffered provider * tests * removing redundant code * docs * wait on empty queue * fix flaky test
* provider: ResettableKeyStore * keystore: remove mutex * use datastore namespace * don't sync to write to altDs * simplify put * deduplicate operation execution code * buffered provider * tests * removing redundant code * docs * wait on empty queue * fix flaky test
* provider: ResettableKeyStore * keystore: remove mutex * use datastore namespace * don't sync to write to altDs * simplify put * deduplicate operation execution code * buffered provider * tests * removing redundant code * docs * wait on empty queue * fix flaky test
Closes #1145
Part of #1095
Supersedes #1148
Summary
Introduces a wrapper around the
SweepingProvider
queuing operations and processing them by batches.This allows users (such as Kubo) of this new
buffered.SweepingProvider
to have a fully async (and fast!)SweepingProvider
.The queue implementation is go-dsqueue.
This solution keeps queuing complexity out of the
SweepingProvider
implementation, and makes the queue optional.Since this is a wrapper, it can wrap either
provider.SweepingProvider
ordual.SweepingProvider
(dual DHT provider).Alternatives
#1148 (draft) also implements queuing but has the following drawbacks:
provider.SweepingProvider
internal need to be exposed for the dual DHT providerMinor changes
dual/provider
toprovider/dual
so that it can accessprovider/internal
.