This repository has been archived by the owner on Feb 12, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: simplify streaming http response code and use instances of pub…
…sub tracker instead of a singleton (#3719) Simplifies deps, pass peer id as string instead of cid.
- Loading branch information
1 parent
b5470d4
commit 9e48da3
Showing
21 changed files
with
295 additions
and
341 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 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 |
---|---|---|
@@ -1,12 +1,18 @@ | ||
'use strict' | ||
|
||
const SubscriptionTracker = require('./subscription-tracker') | ||
|
||
/** | ||
* @param {import('../types').Options} config | ||
*/ | ||
module.exports = config => ({ | ||
ls: require('./ls')(config), | ||
peers: require('./peers')(config), | ||
publish: require('./publish')(config), | ||
subscribe: require('./subscribe')(config), | ||
unsubscribe: require('./unsubscribe')(config) | ||
}) | ||
module.exports = config => { | ||
const subscriptionTracker = new SubscriptionTracker() | ||
|
||
return { | ||
ls: require('./ls')(config), | ||
peers: require('./peers')(config), | ||
publish: require('./publish')(config), | ||
subscribe: require('./subscribe')(config, subscriptionTracker), | ||
unsubscribe: require('./unsubscribe')(config, subscriptionTracker) | ||
} | ||
} |
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
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
Oops, something went wrong.