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.
You can try gioloop.py . This is an implementation of IOLoop s gobject.io_add_watch, therefore it is a single-threaded solution.
gobject.io_add_watch
You can use stream
import threading threading.Thread(target=my_ioloop.start).start()
, 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, , .