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 my gioloop.py. This is a IOLoop implementation with gobject.io_add_watch
, so it's a single-threaded solution.
You could use a thread
import threading
threading.Thread(target=my_ioloop.start).start()
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With