Skip to content
This repository has been archived by the owner on Oct 19, 2022. It is now read-only.

[WIP] pull-streams #19

Merged
merged 4 commits into from
Sep 6, 2016
Merged

[WIP] pull-streams #19

merged 4 commits into from
Sep 6, 2016

Conversation

dignifiedquire
Copy link
Member

Tests are passing but needs clean up and integration verification

@@ -2,7 +2,7 @@
"name": "multistream-select",
"version": "0.10.0",
"description": "JavaScript implementation of the multistream spec",
"main": "lib/index.js",
"main": "src/index.js",
Copy link
Member

Choose a reason for hiding this comment

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

  • change before merge :)

@daviddias
Copy link
Member

Always impressive to see how pull-streams make everything more elegant and smaller

handlersMap[key](new Connection(shake.rest(), rawConn))
} else {
log('unkown protocol: %s', protocol)
defaultHandler(protocol, shake.rest())
Copy link
Member

Choose a reason for hiding this comment

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

what is the defaultHandler?

Copy link
Member Author

Choose a reason for hiding this comment

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

See above, it's a function passed in, allowing to add special handling of non existent protocols.

Copy link
Member

@daviddias daviddias Aug 18, 2016

Choose a reason for hiding this comment

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

That is not part of the spec. If the protocol doesn't exist, na is returned.

@daviddias
Copy link
Member

daviddias commented Sep 2, 2016

Last things to do before merge:

/Users/david/code/js-multistream/src/agreement.js:44
    const [key] = Object.keys(handlersMap).filter((id) => id === protocol)
  • Add documentation of why pull-streams (same as libp2p-tcp)

Good to have:

expect(
data
).to.be.eql(
['banana']
Copy link
Member

Choose a reason for hiding this comment

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

🍌 👌🏽

dignifiedquire and others added 3 commits September 6, 2016 16:03
- add test to verify that both dialer and listener send multistream handshake right away
- fix structure and func naming
- not wait on listener
- support multiple selects
@daviddias
Copy link
Member

Node.js 4 and 5 don't like:

/home/travis/build/multiformats/js-multistream/src/agreement.js:59
      const [key] = Object.keys(handlersMap).filter((id) => id === protocol)

@daviddias daviddias merged commit 3f32f51 into master Sep 6, 2016
@daviddias
Copy link
Member

another one bites the dust!

@daviddias daviddias deleted the pull branch September 6, 2016 20:29
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants