Skip to content

Commit e40aec6

Browse files
committed
docs: overwritten functions
1 parent 1e4ce8c commit e40aec6

File tree

4 files changed

+35
-3
lines changed

4 files changed

+35
-3
lines changed

.travis.yml

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
language: node_js
2+
cache: npm
3+
stages:
4+
- check
5+
- test
6+
- cov
7+
8+
node_js:
9+
- '10'
10+
11+
os:
12+
- linux
13+
- osx
14+
- windows
15+
16+
script: npx nyc -s npm run test -- --bail
17+
after_success: npx nyc report --reporter=text-lcov > coverage.lcov && npx codecov
18+
19+
jobs:
20+
include:
21+
- stage: check
22+
script:
23+
- npx aegir commitlint --travis
24+
- npx aegir dep-check
25+
- npm run lint
26+
27+
notifications:
28+
email: false

README.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,11 @@ js-libp2p-pubsub
3232

3333
## Usage
3434

35-
A pubsub implementation **MUST** override the `_processConnection`, `publish`, `subscribe` and `unsubscribe` functions. `add_peer` and `remove_peer` may be overwritten if the pubsub implementation needs to add custom logic when peers are added and remove. All the remaining functions **MUST NOT** be overwritten.
35+
A pubsub implementation **MUST** override the `_processConnection`, `publish`, `subscribe` and `unsubscribe` functions.
36+
37+
Other functions, such as `_addPeer`, `_removePeer`, `_onDial`, `start` and `stop` may be overwritten if the pubsub implementation needs to add custom logic on them. It is important pointing out that `start` and `stop` must call `super`. The `start` function is responsible for mounting the pubsub protocol onto the libp2p node and sending its' subscriptions to every peer conneceted, while the `stop` function is responsible for unmounting the pubsub protocol and shutting down every connection
38+
39+
All the remaining functions **MUST NOT** be overwritten.
3640

3741
The following example aims to show how to create your pubsub implementation extending this base protocol. The pubsub implementation will handle the subscriptions logic.
3842

ci/Jenkinsfile

-2
This file was deleted.

package.json

+2
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,9 @@
6060
"err-code": "^1.1.2",
6161
"length-prefixed-stream": "^1.6.0",
6262
"protons": "^1.0.1",
63+
"pull-length-prefixed": "^1.3.1",
6364
"pull-pushable": "^2.2.0",
65+
"pull-stream": "^3.6.9",
6466
"time-cache": "~0.3.0"
6567
},
6668
"contributors": [

0 commit comments

Comments
 (0)