Last active
August 29, 2015 14:20
-
-
Save juliangruber/866f388f0b9e2e591462 to your computer and use it in GitHub Desktop.
multiplex test
This file contains hidden or 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
| var multiplex = require('multiplex'); | |
| var a = multiplex(function(stream, meta){ | |
| console.log('a meta', meta) | |
| }) | |
| var b = multiplex(function(stream, meta){ | |
| console.log('b meta', meta) | |
| }) | |
| a.pipe(b).pipe(a) | |
| a.createStream('foo') | |
| a.createStream('foo') | |
| b.createStream('foo') | |
| b.createStream('foo') |
This file contains hidden or 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
| ∴ mt : node index.js | |
| b meta foo | |
| b meta foo | |
| a meta foo | |
| a meta foo |
This file contains hidden or 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
| { | |
| "dependencies": { | |
| "multiplex": "^5.0.0" | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment