-
Notifications
You must be signed in to change notification settings - Fork 95
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
provider: refactor to only maintain one batched implementation and add throughput callback #273
Conversation
f450d31
to
e5be496
Compare
@Jorropo can you update this once you have time so that the tests are passing? I can take a look after (also add some motivation on why this is beneficial for more context, please). |
1a119c1
to
8d9e801
Compare
Codecov Report
@@ Coverage Diff @@
## main #273 +/- ##
==========================================
+ Coverage 49.36% 50.44% +1.08%
==========================================
Files 281 279 -2
Lines 33708 33586 -122
==========================================
+ Hits 16640 16944 +304
+ Misses 15329 14886 -443
- Partials 1739 1756 +17
|
fb36b39
to
cedadbf
Compare
Yes, agreed that the context for where this is coming from and why we're prioritizing it now would be great. It's not currently on the 0.21 iteration. (I'll add it now.) |
30d1ef9
to
80d8715
Compare
Is this ready to be reviewed @Jorropo? |
Related to ipfs/kubo#9703 |
a19c0c0
to
0827951
Compare
Fixes: ipfs#9704 Fixes: ipfs#9702 Fixes: ipfs#9482 Depends on: ipfs/boxo#273
Fixes: ipfs#9704 Fixes: ipfs#9702 Depends on: ipfs/boxo#273
2023-05-23 maintainer conversation: Context: we know this will get rewritten again when it moves into the DHT. As a result, this doesn't have to be perfect. @guillaumemichel : can you please look at this (given this is relevant to future code for the DHT)? We want to make sure you have context here when future DHT rewriting happens. @aschmahmann will look at the test code. @Jorropo : add a changelog.md entry |
The function below is not deterministic and only has a 50% chance to return an error when the context is done. boxo/provider/internal/queue/queue.go Lines 57 to 65 in 04cf63e
I rewrote it, feel free to update if required boxo/provider/internal/queue/queue.go Lines 57 to 71 in 08e0680
|
I relocated some magic numbers in reprovider.go Lines 21 to 37 in c1d114c
Note that I updated the |
Fixes: ipfs#9704 Fixes: ipfs#9702 Depends on: ipfs/boxo#273
…d throughput callback This code does a few things: 1. Remove the simple provider to avoid duplicating features. 2. Add the support for single providing on the batched provider. 3. Fix a bugs in the batched provider. 4. Add support for a throughputCallback in the batched provider. 6. Add support for an offline mode of the batched provider (stuff is exclusively pushed onto the queue). 5. Move the batched provider to be the only provider and make the queue implementation private.
@Jorropo : this is good to merge right? |
@BigLep I'll submit changelog update first |
Fixes: ipfs#9704 Fixes: ipfs#9702 Fixes: ipfs#9703 Fixes: ipfs#9419 Depends on: ipfs/boxo#273
Fixes: ipfs#9704 Fixes: ipfs#9702 Fixes: ipfs#9703 Fixes: ipfs#9419 Depends on: ipfs/boxo#273
This code does a few things: