socket.io-stream
Advanced tools
Comparing version 0.7.0 to 0.8.0
@@ -102,6 +102,15 @@ var util = require('util'); | ||
var self = this; | ||
var args = slice.call(arguments, 1); | ||
var sio = this.sio; | ||
var ack = args[args.length - 1]; | ||
if ('function' == typeof ack) { | ||
args[args.length - 1] = function() { | ||
var args = slice.call(arguments); | ||
args = self.decoder.decode(args); | ||
ack.apply(this, args); | ||
}; | ||
} | ||
args = this.encoder.encode(args); | ||
var sio = this.sio; | ||
sio.emit.apply(sio, [exports.event, type].concat(args)); | ||
@@ -160,3 +169,12 @@ }; | ||
debug('new streams'); | ||
var self = this; | ||
var args = slice.call(arguments); | ||
var ack = args[args.length - 1]; | ||
if ('function' == typeof ack) { | ||
args[args.length - 1] = function() { | ||
var args = slice.call(arguments); | ||
args = self.encoder.encode(args); | ||
ack.apply(this, args); | ||
}; | ||
} | ||
@@ -166,2 +184,3 @@ args = this.decoder.decode(args); | ||
} | ||
// for removeListener | ||
@@ -168,0 +187,0 @@ onstream.listener = listener; |
{ | ||
"name": "socket.io-stream", | ||
"version": "0.7.0", | ||
"version": "0.8.0", | ||
"description": "stream for socket.io", | ||
@@ -5,0 +5,0 @@ "author": "Naoyuki Kanezawa <naoyuki.kanezawa@gmail.com>", |
@@ -147,2 +147,5 @@ # Socket.IO stream | ||
ss(socket).emit('flexible', [stream1, { foo: stream2 }]); | ||
// get streams through the ack callback | ||
ss(socket).emit('ack', function(stream1, stream2) { ... }); | ||
``` | ||
@@ -149,0 +152,0 @@ |
Sorry, the diff of this file is too big to display
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
195764
5953
220