Skip to content
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

feat: provider manager option #591

Closed
wants to merge 1 commit into from
Closed

feat: provider manager option #591

wants to merge 1 commit into from

Conversation

alanshaw
Copy link
Member

The PR adds an option to allow passing your own instance of provider manager when constructing a DHT.


In Hydra, we have many heads (up to 200 currently) that have their own DHT instances and corresponding provider managers. They are all caching records and performing GC on a shared datastore.

I'd like to avoid multiple GC runs and out-of-sync caches. In this PR I seek to fix this by enabling the DHT to accept a provider manager as an option, allowing a single provider manager to be used for all hydra heads.

We've defined a ProviderStore interface that ProviderManager (already) implements. By using an interface we give ourselves room to pass a custom implementation (at a later date maybe...since we will encounter the problem again when using the postgres datastore to share between Hydras, in addition to Hydra heads).

⚠️ BREAKING CHANGE - it removes the dht.ProviderManager property in favor of a dht.ProviderStore() function.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant