-
Notifications
You must be signed in to change notification settings - Fork 4
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: Race top n nodes when making requests #25
Merged
Merged
Changes from all commits
Commits
Show all changes
40 commits
Select commit
Hold shift + click to select a range
804978c
feat: implement a nodes list for clients
AmeanAsad f4d1844
feat: implement a storage interface using indexedDb
AmeanAsad 894d16d
feat: implement a test suite for fallback
AmeanAsad 7009c7a
fix: remove unused code
AmeanAsad 3336a87
fix: eslint an jsdoc
AmeanAsad 696cd8a
fix: formatting and consistency
AmeanAsad a3dec56
fix: indexDbCheck
AmeanAsad 747d780
Merge branch 'main' into feat/fallback
AmeanAsad 8dec1c7
chore: change storage implementation
AmeanAsad b0dc673
enhancement: simplify node loading
AmeanAsad 78651fc
naive fallback implementation
AmeanAsad d15c0ad
modify fallback
AmeanAsad 29e8da1
fix formatting and typos
AmeanAsad 194ce70
typos
AmeanAsad 1d97dc9
Update .eslintrc
AmeanAsad 84a1b8e
enhancement: edit storage impl
AmeanAsad f688406
enhancement: deal with overlapping byte chunks
AmeanAsad 5b7c215
feat: add fallback test suite
AmeanAsad 6068a90
fix: tests running
AmeanAsad 2c3cc79
cleanup content fetch with fallback
AmeanAsad 4cf0c00
add initial origin fetch to fallback
AmeanAsad d81038f
formatting and file re-org
AmeanAsad a1ecd50
feat: merge main into fallback branch (#22)
AmeanAsad 55d56d1
Merge branch 'main' into feat/fallback
AmeanAsad d2c5c37
load nodes on first success
AmeanAsad e0065d8
add fallback limit
AmeanAsad 109019b
fix: fallback bug
AmeanAsad b84ce4a
put eslint settings in package.json
AmeanAsad 7731fe8
add nodesListKey as static
AmeanAsad e0fcfd8
fix: resolve process in browser
AmeanAsad ac1b9f8
Merge branch 'main' into feat/fallback
AmeanAsad 489842a
feat: add fetching with a race
AmeanAsad 9de35fc
enhancement: add backward compatibility for racing
AmeanAsad c06a2b6
tests and cleanup
AmeanAsad ceda4c2
Merge branch 'main' into feat/race-nodes
AmeanAsad 7249aea
fixes and enhancements
AmeanAsad 57697d2
add typings
AmeanAsad c0e3e93
Merge branch 'main' into feat/race-nodes
AmeanAsad 7d0b34e
add typings
AmeanAsad 4ef930c
Merge branch 'main' into feat/race-nodes
AmeanAsad File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
|
||
/** | ||
* @module types */ | ||
|
||
/** | ||
* | ||
* @typedef {object} Node | ||
* @property {string} ip | ||
* @property {number} weight | ||
* @property {number} distance | ||
* @property {string} url | ||
*/ | ||
|
||
export {} |
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So if we have nodes a,b,c,d,e, then the race groups are:
Is that right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is correct. Will also note that this is not necessarily the best way to do it and has some obvious room for improvement. For example:
I think as a next step, the best way to do this is to remove nodes that fail and such that:
I think this can be better achieved with a hashring implementation but we can re-evaluate.