Gobject.MainLoop and tornado.IOLoop right away?

How can you run two event loops in one application?

I need to use tornado.IOLoop (WebSocket client) and gobject.MainLoop (pygtk) in one Python program.

Update: Threadless solutions are preferred.

+4
source share
3 answers

You can try gioloop.py . This is an implementation of IOLoop s gobject.io_add_watch, therefore it is a single-threaded solution.

+2
source

You can use stream

import threading
threading.Thread(target=my_ioloop.start).start()
+1
source

, Tornado gobject Twisted. "Tornado on Twisted" http://www.tornadoweb.org/en/stable/twisted.html#tornado-on-twisted Twisted gireactor (http://twistedmatrix.com/documents/13.1.0/api/twisted.internet.gireactor.html).

IOLoop, gobject, Twisted, , .

0

All Articles