Skip to content
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/pull mplex #4

Merged
merged 50 commits into from
Feb 7, 2019
Merged
Changes from 1 commit
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
3c5caed
feat: initial commit
dryajov Apr 15, 2018
7c6bdf1
feat: correct channel closing
dryajov Mar 31, 2018
2798b03
feat: getting interface-stream-muxer tests to pass
dryajov Apr 1, 2018
0987b24
feat: improve performance
dryajov Apr 3, 2018
c8f2115
feat: correct encoding/decoding
dryajov Apr 3, 2018
117adbb
feat: correct encoding and channel closing
dryajov Apr 3, 2018
fb79753
feat: correct channel and plex closing
dryajov Apr 5, 2018
284fd44
feat: interop with old libp2p-mplex
dryajov Apr 6, 2018
aeee3d9
fix: correctly read chunked data
dryajov Apr 8, 2018
1a97616
feat: interep with old stream based mplex
dryajov Apr 8, 2018
e2f4579
feat: avoid negative sizes
dryajov Apr 8, 2018
56694e0
feat: dont close channel too early
dryajov Apr 9, 2018
e9cd98d
feat: validation and coverage
dryajov Apr 10, 2018
79f5a60
fix: correct channel id sequence
dryajov Apr 11, 2018
487ff5d
feat: use bl to avoid buffer concat/copy
dryajov Apr 14, 2018
2272897
chore: renaming back to pull-mplex
dryajov Apr 15, 2018
de7f5bb
chore: rename old to stream-mplex-interop
dryajov Apr 15, 2018
66473b5
chore: adding misc files
dryajov Apr 15, 2018
bfd691e
chore: license
dryajov Apr 15, 2018
3bc0908
feat: use two lists to avoid clashes
dryajov Apr 18, 2018
18d43eb
style: formatting
dryajov Apr 18, 2018
dc95ed9
feat: remove unused deps
dryajov Apr 18, 2018
ff8e56a
feat: update README.md
dryajov Apr 2, 2018
b340326
feat: performance
dryajov Apr 21, 2018
9a5a867
chore: update repo link
dryajov Apr 21, 2018
6659c45
fix: dont use bl
dryajov Apr 24, 2018
86eab54
perf: optimize
dryajov Apr 24, 2018
1e9f794
style: fix formating
dryajov Apr 24, 2018
64794fe
perf: improoving performance
dryajov Apr 27, 2018
8c26286
style: remove unused variable
dryajov Apr 28, 2018
fa387c5
fix: msg length encoding
dryajov Apr 30, 2018
adc1884
fix: dont blow up the stack
dryajov May 5, 2018
0fc4ca1
fix: use arrow function
dryajov May 8, 2018
5c2c914
fix: remove initiator id logic
dryajov May 9, 2018
3b29ca5
fix: start channel from 0
dryajov May 9, 2018
1dbe5dc
chore: adding commitizen
dryajov May 9, 2018
01fd7e3
feat: initial commit
dryajov Mar 26, 2018
54a249b
feat: getting interface-stream-muxer tests to pass
dryajov Apr 1, 2018
4c537d5
chore: remove unused file
dryajov May 10, 2018
5431c65
feat: send chan name
dryajov May 10, 2018
7f67df8
fix: send chan name when creating stream
dryajov May 10, 2018
c8a1c7e
fix: remove nyc_output file
dryajov May 11, 2018
a1d9788
chore: move benchmarks and inteop to libp2p-mplex
dryajov May 15, 2018
22ef8d0
chore: remove non jenkins ci
jacobheun Feb 5, 2019
b895055
chore: update dependencies
jacobheun Feb 6, 2019
b59b1fe
fix: listen to the channel error
jacobheun Feb 6, 2019
0eaf7d8
refactor: spread op instead of lodash defaults
jacobheun Feb 6, 2019
cb8b719
refactor: avoid toString when debug not enabled
jacobheun Feb 6, 2019
03520cc
docs: add more comments
jacobheun Feb 6, 2019
ef06716
docs: add more js docs
jacobheun Feb 6, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,12 @@ class Mplex extends EE {
chan.once('close', () => {
list[id] = null
})
chan.once('error', (_) => {
// TODO: Should we handle this? Internally the channel
// is handling errors. In node 10+ if we dont catch this
// error, it will be thrown. Perhaps channel shouldnt be
// emitting errors?
})
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was needed to fix an error with the test suite, because there was no error listener on channel. I need to do some more testing, but I don't think the channel needs to be emitting errors. It appears to be handling everything internally and reseting the stream properly, so I think it's probably redundant anyway.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the Channel should be emitting errors, but those needs to be catched here and logged. A lot of channel erroring might be a smell than it's better to tear down the connection?


list[id] = chan
return chan
Expand Down