stream-url
Advanced tools
Comparing version 0.0.12 to 0.0.14
{ | ||
"name": "stream-url", | ||
"version": "0.0.12", | ||
"version": "0.0.14", | ||
"homepage": "http://github.com/gritzko/stream-url", | ||
@@ -18,3 +18,2 @@ "repository": { | ||
"test/*.js", | ||
"index.js", | ||
"LICENSE", | ||
@@ -21,0 +20,0 @@ "README.md" |
@@ -34,2 +34,4 @@ Stream URLs | ||
[![Build Status](https://travis-ci.org/gritzko/stream-url.svg?branch=master)](https://travis-ci.org/gritzko/stream-url) | ||
## API | ||
@@ -36,0 +38,0 @@ |
@@ -20,3 +20,3 @@ "use strict"; | ||
ZeroStream.prototype.drainQueue = function () { | ||
ZeroStream.prototype.drain_queue = function () { | ||
try { | ||
@@ -52,3 +52,3 @@ while (this.data.length && this.on_data) { | ||
if (something!==undefined && something!==null) { | ||
if (this.pair.on_data) { | ||
if (this.pair.on_data && !this.pair.data.length) { | ||
try { | ||
@@ -55,0 +55,0 @@ this.pair.on_data(something); |
@@ -14,2 +14,3 @@ "use strict"; | ||
t.plan(8); | ||
// 0: listener is ready immediately and invokes a callback synchronously | ||
var server = su.listen('0:string', function(err, serv) { | ||
@@ -36,3 +37,2 @@ serv_rem = serv; | ||
t.pass('stream ends'); // TODO | ||
t.end(); | ||
}); | ||
@@ -45,7 +45,11 @@ stream.write(dummy_object); | ||
tape ('1.B connect fail', function (t) { | ||
t.plan(2); | ||
t.plan(4); | ||
var callback_called = false; | ||
su.connect('0:nonexisting', function (err, stream) { | ||
t.ok(err, 'got an error'); | ||
t.notOk(stream, 'no stream'); | ||
t.notOk(callback_called, 'callback invoked twice'); | ||
callback_called = true; | ||
}); | ||
t.notOk(callback_called, 'callback invoked synchronously'); | ||
}); | ||
@@ -73,1 +77,18 @@ | ||
}); | ||
tape ('1.D drain queue', function (t) { | ||
su.listen('0:abc', function (err, server) { | ||
server.on('connection', function (stream) { | ||
var async = false; | ||
stream.on('data', function(data) { | ||
t.equal(data, 'queued'); | ||
t.equal(async, true); | ||
t.end(); | ||
}); | ||
async = true; | ||
}); | ||
}); | ||
su.connect('0:abc', function (err, stream) { | ||
stream.write('queued'); | ||
}); | ||
}); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
14311
303
74