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: refactor to only maintain one batched implementation and ad…
…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.
- Loading branch information
Showing
16 changed files
with
556 additions
and
1,190 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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,32 @@ | ||
package provider | ||
|
||
import ( | ||
"context" | ||
|
||
"github.com/ipfs/go-cid" | ||
) | ||
|
||
type noopProvider struct{} | ||
|
||
var _ System = (*noopProvider)(nil) | ||
|
||
// NewNoopProvider creates a ProviderSystem that does nothing. | ||
func NewNoopProvider() System { | ||
return &noopProvider{} | ||
} | ||
|
||
func (op *noopProvider) Close() error { | ||
return nil | ||
} | ||
|
||
func (op *noopProvider) Provide(cid.Cid) error { | ||
return nil | ||
} | ||
|
||
func (op *noopProvider) Reprovide(context.Context) error { | ||
return nil | ||
} | ||
|
||
func (op *noopProvider) Stat() (ReproviderStats, error) { | ||
return ReproviderStats{}, nil | ||
} |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.