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: implement stable hashring for node management #30

Merged
merged 51 commits into from
Dec 19, 2023
Merged

Conversation

AmeanAsad
Copy link
Contributor

@AmeanAsad AmeanAsad commented Oct 26, 2023

Description

  • Implements a hashring implementation to dictate which nodes receive requests
  • the hashring should direct requests to the same cid to the same nodes.
  • the hashring supports fallback functionality; it's able to return multiple nodes given a cid path.
  • the nodes in the hashring are weighted, so closer nodes with higher performance are more likely to receive requests.

AmeanAsad and others added 30 commits October 11, 2023 00:17
Co-authored-by: Diego Rodríguez Baquero <diego@protocol.ai>
* Abort on error (#19)

* feat: use controller from options if exists. abort fetch if error occurs.

* test: check if external abort controller is used

* build: move build output to dist/ folder

* fix: newline

* 0.1.1

* Build exports (#20)

* chore: rename file

* feat: add new entrypoint with exports.

Switch Saturn to named export

* build: expose entire module instead of just the default export

* docs: update README

* 0.2.0

* feat: include worker scopes when checking for browser runtime (#21)

* 0.3.0

---------

Co-authored-by: Eric Guan <guanzo91@gmail.com>
@AmeanAsad AmeanAsad marked this pull request as ready for review October 26, 2023 20:06
@AmeanAsad AmeanAsad requested a review from guanzo October 26, 2023 20:07
src/client.js Outdated Show resolved Hide resolved
@AmeanAsad
Copy link
Contributor Author

@guanzo ready for review again

@guanzo
Copy link
Collaborator

guanzo commented Dec 6, 2023

the hashring supports fallback functionality; it's able to return multiple nodes given a cid path.

I'm thinking we should code for the worst case, and allow falling back to ALL available nodes, if the nodes for the cid path all fail.

@AmeanAsad AmeanAsad merged commit cc7a758 into main Dec 19, 2023
1 check passed
@AmeanAsad AmeanAsad deleted the feat/hashring branch December 19, 2023 16:35
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.

2 participants