forked from libp2p/js-libp2p-delegated-content-routing
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
All HTTP requests made by this module are sent to the same delegate host. Browsers throttle the number of concurrent requests per hostname, right now it is 6 per host, which suffocates the use of delegate and blocking it from being used for preload or delegated peer routing. This change introduces task queues that limit the number of concurrent requests, making it safe to run in browser context. Optimizations: - preload calls via `refs` are known to take time, so we limit them to max two at a time - swarm.connect was the main offender (causing multiple requests to delegate), we now check if connection is already present and cache result for 1 minute removing most of redundant http requests - hostname of default delegate is changed Context: libp2p#12 Closes libp2p#12 License: MIT Signed-off-by: Marcin Rataj <lidel@lidel.org>
- Loading branch information
Showing
4 changed files
with
69 additions
and
22 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -61,4 +61,5 @@ typings/ | |
.env | ||
|
||
yarn.lock | ||
package-lock.json | ||
package-lock.json | ||
dist/ |
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