generated from ipfs/ipfs-repository-template
-
Notifications
You must be signed in to change notification settings - Fork 95
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
provider: revert throughput callback and related refactor
This reverts commits: - 0ff6929: provider: add breaking changes to the changelog (#330) - 0962ed6: relocated magic numbers, updated Reprovide Interval from 24h to 22h - ac047a5: provider: refactor to only maintain one batched implementation and add throughput callback This seems to have an unknown deadlock that is blocking Kubo's sharness tests, the code coverage is also pretty bad I forgot to migrate the pinning reproviding tests because they weren't ran directly over batched. https://app.codecov.io/gh/ipfs/boxo/commit/20e2aae45ec6ecd21c905993c394e9cc767c9038/tree/provider
- Loading branch information
Showing
17 changed files
with
1,198 additions
and
580 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
## Usage | ||
|
||
Here's how you create, start, interact with, and stop the provider system: | ||
|
||
```golang | ||
import ( | ||
"context" | ||
"time" | ||
|
||
"github.com/ipfs/boxo/provider" | ||
"github.com/ipfs/boxo/provider/queue" | ||
"github.com/ipfs/boxo/provider/simple" | ||
) | ||
|
||
rsys := (your routing system here) | ||
dstore := (your datastore here) | ||
cid := (your cid to provide here) | ||
|
||
q := queue.NewQueue(context.Background(), "example", dstore) | ||
|
||
reprov := simple.NewReprovider(context.Background(), time.Hour * 12, rsys, simple.NewBlockstoreProvider(dstore)) | ||
prov := simple.NewProvider(context.Background(), q, rsys) | ||
sys := provider.NewSystem(prov, reprov) | ||
|
||
sys.Run() | ||
|
||
sys.Provide(cid) | ||
|
||
sys.Close() | ||
``` |
Oops, something went wrong.