[zeromq-dev] python lruqueue.py implementation

Guillaume Aubert guillaume.aubert at gmail.com
Tue Dec 14 15:33:59 CET 2010


Hi,

In order to learn more about 0MQ I have written the lruqueue.py example.
The code is licensed your code under the MIT/X11 license and available
to complete the examples python dir.

You can see the code in the following gist:
https://gist.github.com/740488

I have one remark and 2 comments about it:

- I strictly followed the C implementation so it might not be fully pythonic.

- the worker threads run infinitely in the C code so I did the same
but when the context is terminated all the workers go into exception.
I catched this specific exception to have them finishing smoothly. We
could do something a bit better and send the worker a stop message but
it complicates a bit the workers. Let me know what you prefer.

- In the case of a zmq.REQ socket, the python binding is eating the empty frame.

Let me know what you think about it ?
If this is good enough, let me know what I need to do to update the
current example.

Many thanks,

Guillaume



More information about the zeromq-dev mailing list