[zeromq-dev] best way to integrate pyzmq & pyqt event loops
Brian Granger
ellisonbg at gmail.com
Wed Apr 27 06:12:54 CEST 2011
Hi,
Here is example of how we are doing this in IPython:
https://github.com/ipython/ipython/blob/master/IPython/zmq/ipkernel.py#L450
But, we are not using the IOLoop in this example. If you also want to
use the Qt event loop for IO related things, you will probably need to
integrate the file descriptors of the zeromq sockets into the Qt event
loop itself. I don't really know enough about Qt to know where to
start with this.
I guess the other option would to use a periodic call in IOLoop to
iterate the Qt event loop. That might be easier. Let us know what
you find out.
Cheers,
Brian
On Tue, Apr 26, 2011 at 4:56 PM, Marc Rossi <mrossi19 at gmail.com> wrote:
> Looking for a little direction. Trying to put together a PyQt app to view
> some of the google protobuf encoded data I'm slinging around from my C/C++
> apps with zmq. Have the pyzmq/google protobuf stuff working no problem but
> trying to figure out the best way to integrate the QApplication event loop
> with the IOLoop instance I have in my script. First thoughts are to use the
> QApplication event handler as my primary loop with idle callbacks to do my
> zmq socket polling.
> I'm by no means a PyQt expoert and I have to think someone has been down
> this path before (event though searches turned up empty), so any
> advice/direction that can be thrown my way would be much appreciated. In
> the meantime I'm going to try and do zmq event processing in the qt
> callbacks.
> TIA
> Marc
> _______________________________________________
> zeromq-dev mailing list
> zeromq-dev at lists.zeromq.org
> http://lists.zeromq.org/mailman/listinfo/zeromq-dev
>
>
--
Brian E. Granger
Cal Poly State University, San Luis Obispo
bgranger at calpoly.edu and ellisonbg at gmail.com
More information about the zeromq-dev
mailing list