Skip to content

Instantly share code, notes, and snippets.

@pmarques
Created July 15, 2011 09:19
Show Gist options
  • Save pmarques/1084375 to your computer and use it in GitHub Desktop.
Save pmarques/1084375 to your computer and use it in GitHub Desktop.
resolve asyncsrv.pl issue, the original example doesn't work!
60c59,69
< zmq.device(zmq.QUEUE, frontend, backend)
---
> while True:
> sockets = dict(poll.poll())
> if frontend in sockets:
> if sockets[frontend] == zmq.POLLIN:
> msg = frontend.recv()
> print 'Server received %s' % (msg)
> backend.send(msg)
> if backend in sockets:
> if sockets[backend] == zmq.POLLIN:
> msg = backend.recv()
> frontend.send(msg)
77d85
< src = worker.recv()
83d90
< worker.send(src, zmq.SNDMORE)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment