Skip to content
This repository has been archived by the owner on Aug 29, 2023. It is now read-only.

Commit

Permalink
feat: add priorities for transports
Browse files Browse the repository at this point in the history
  • Loading branch information
dryajov committed Apr 2, 2017
1 parent 9b02808 commit 574ce3b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
3 changes: 2 additions & 1 deletion package.json
Expand Up @@ -43,6 +43,7 @@
},
"dependencies": {
"interface-connection": "~0.3.2",
"interface-transport": "^0.3.4",
"ip-address": "^5.8.6",
"lodash.includes": "^4.3.0",
"lodash.isfunction": "^3.0.8",
Expand All @@ -61,4 +62,4 @@
"Richard Littauer <richard.littauer@gmail.com>",
"Stephen Whitmore <stephen.whitmore@gmail.com>"
]
}
}
8 changes: 8 additions & 0 deletions src/index.js
Expand Up @@ -13,6 +13,14 @@ const log = debug('libp2p:tcp:dial')
const createListener = require('./listener')

module.exports = class TCP {
get priority () {
return 1 // TODO: move to a constants file that all transports can share
}

set priority (val) {
throw new Error('Priority is read only!')
}

dial (ma, options, cb) {
if (isFunction(options)) {
cb = options
Expand Down

0 comments on commit 574ce3b

Please sign in to comment.