diff --git a/README.md b/README.md index 6c33609..fd9785a 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ The API is presented with both Node.js and Go primitives, however, there is not # Modules that implement the interface -- +- [https://github.com/diasdavid/node-spdy-stream-muxer](Node.js spdy-stream-muxer) - stream-muxer abstraction on top of [spdy-transport](https://github.com/indutny/spdy-transport) Send a PR to add a new one if you happen to find or write one. diff --git a/package.json b/package.json index f99c2b4..f4bbdab 100644 --- a/package.json +++ b/package.json @@ -26,6 +26,7 @@ }, "homepage": "https://github.com/diasdavid/abstract-stream-muxer", "dependencies": { + "dev-null": "^0.1.1", "stream-pair": "^1.0.3" } } diff --git a/tests/stress-test.js b/tests/stress-test.js index 514e04c..4870a5a 100644 --- a/tests/stress-test.js +++ b/tests/stress-test.js @@ -1,30 +1,22 @@ -/* knobs - nStreams, nMsg, sizeMsg[low, high] */ - var streamPair = require('stream-pair') +var devNull = require('dev-null') module.exports.all = function (test, common) { - test('Open a stream from the dealer', function (t) { + test('1 stream with 10Mb file', function (t) { common.setup(test, function (err, Muxer) { - t.plan(4) - t.ifError(err, 'Should not throw') - + t.ifError(err, 'should not throw') var pair = streamPair.create() - var dialer = new Muxer() - var listener = new Muxer() - var connDialer = dialer.attach(pair) - var connListener = listener.attach(pair.other) - - connDialer.dialStream(function (err, stream) { - t.ifError(err, 'Should not throw') - t.pass('dialed stream') - }) - - connListener.on('stream', function (stream) { - t.pass('got stream') - }) + spawnGeneration(t, Muxer, pair, pair.other, 1, [10, 10]) }) }) +} + +function spawnGeneration (t, Muxer, dialerSocket, listenerSocket, nStreams, sizeWindow) { } + +function randSizeMsg (sizeWindow) { + return Math.floor(Math.random() * (sizeWindow[1] - sizeWindow[0] + 1)) + sizeWindow[0] +}