JustinTulloss/zeromq.node — pull request #139 by ichernev (2012-08-12 10:49:05+00:00)
Title: Implemented pause/resume for sockets

zeromq is a message queue, so it should be able to queue messages.
pause/resume enable you to queue incomming messages in zeromq's queue.

The only think that worries me in this implementation, is that `message` events are handled in the middle of a `flush`, but there is recursion prevention in `flush`, so it should work unless I'm missing something.

Another way to implement is to keep already recv'd messages from zeromq in an js array -- in this way 'message' can be emitted later, but then there should be logic on emitting to check if the socket is paused. Resuming would then first flush the js array and then start recv-ing from zeromq socket.