Conversation
could you add a test? I'm not really sold on having a second method for it, plus this is camelcase land :p but yeah we could add variable arg support back to |
what do you think? |
this._outgoing.push([msg, flags || 0]); | ||
Socket.prototype.send = function(msgs, flags) { | ||
if (!Array.isArray(msgs)) msgs = [msgs] | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this method is hot so we should make sure to optimize, things like ditching msg.forEach(
etc
In the current code base multipart send is buggy, so you should probably either implement the emit on nextTick change or the don't flush if sndmore flag change. The problem is that if you call send('1',zmq.ZMQ_SNDMORE) and then send('2'), the flush from first send may emit a 'message' event and if one of the listeners of the message event calls send then the frames of message are not going to be delivered in the expected order. |
+1 on fixing this issue. ZeroMQ without multipart is unusable (for me, anyway). |
Hello, indeed before near complete rewrite of zmq node we were able to do this : sock.send('frame1', 'frame2', 'frame3'); and then receive sock.on('message', function(msgArr) {
console.log(msgArr[0], msgArr[1], msgArr[2]);
}); Breaking this made the module not usable by people using this kind of messages. +1 so ! |
sorry for the delay :D |
Thanks, much appreciated! |
ya - thanks. |
Added Socket#send_mutli and fixed bug in Socket#_flush that occured when a message was received in the middle of send_multi call.