Using pyglet, twisted, pygtk together in an application

I am creating an application that allows you to play music synchronously on different systems. For the project, I decided to use twisted, PyGtk2, Pyglet. I am confused about how the main loop should work. Should I run the pinglet loop in a separate thread or should I implement a new reactor integrating twisted pygtk2, pyglet. Will performance affect if I try to combine the three loops together?

+5
source share
2 answers

I used https://github.com/padraigkitterick/pyglet-twisted while playing with picket and twisted, and it worked on my toys. A good starting point, anyway.

Above is a new ThreadedSelectReactor based reactor.

I don’t understand what the composition of all three will look like ...

+4
source

Twisted already has a solution for integration with gtk: http://twistedmatrix.com/documents/current/core/howto/choosing-reactor.html#core-howto-choosing-reactor-gtk

I am not familiar with the piglet, but if it has a main loop such as GTK, then both of your ideas seem doable. You can also see how twisted implements the GTK integration described in the link above and try to reproduce it for a piglet.

+2
source

Source: https://habr.com/ru/post/1210668/


All Articles