Snippet for Twisted + Kivy
Need.
like a small code snippet to show how to integrate twisted reactor into kivy event loop (can we run it in separate thread)?
or a specific/standard way of integrating twisted with kivy?
Yes, snippet about how to integrate twisted reactor in kivy loop. Kivy as master, twisted as slave.
like this?
https://gist.github.com/1181570
does not stop correctly, any idea why?
this is better, stops correctly and handles SIGINT https://gist.github.com/1181789
Very nice, but i would prefer if that could be done withing https://github.com/tito/kivy/blob/master/kivy/support.py ? I think we have global start/stop global app event (not App class). If not, maybe add it, and plug twisted on it.
Then, as gobject integration, we could do:
from kivy.support import install_twisted_iteration
install_twisted_iteration()
Does that make more sense to you too ?
Where in the documentation should this go?
I think maybe one of these :
- Technical FAQ (maybe hard to find?)
- Programming Guide after Designing with Kivy Language
possible but probably overkill:
- put twistedapp in an extension ?
- Add TwistedApp to kivy/app.py, and add it to the module documentation ?
agreed: install_twisted_iteration will be best. I will add it there.
kivy/supprt is not part of documentation though, should I add it in API docs under Kivy Framework?
Not technical faq, but definitively in the Programming Guide, maybe new section about "Integrate other frameworks with Kivy" or something like that.
But most of the documentation should go in kivy/support.py for twisted. I really don't think we need a TwistedApp. If i would do like that, gobject have their own event loop, twisted too, etc. Best is to abstract them in support.py, and use install() before using the framework. The App class is not changed at all, and the user can still use the framework in his own way.
Just a matter of reorganisation, since you already got everything running :)
Mathieu
- hansent [email protected] [2011-08-30 12:43:28]:
Where in the documentation should this go?
I think maybe one of these :
- Technical FAQ (maybe hard to find?)
- Programming Guide after Designing with Kivy Language
possible but probably overkill:
- put twistedapp in an extension ?
- Add TwistedApp to kivy/app.py, and add it to the module documentation ?
Reply to this email directly or view it on GitHub: https://github.com/tito/kivy/issues/214#issuecomment-1947611
yep
- hansent [email protected] [2011-08-30 12:48:12]:
agreed: install_twisted_iteration will be best. I will add it there.
kivy/supprt is not part of documentation though, should I add it in API docs under Kivy Framework?
Reply to this email directly or view it on GitHub: https://github.com/tito/kivy/issues/214#issuecomment-1947657
ready to be closed after pull-request is merged
Just to note that Hansent gist solved my issue that I asked in this SO page : http://stackoverflow.com/questions/25784607/why-in-windows-i-can-run-kivy-app-run-from-within-twisted-reactor-callinthread. I think it's better if the above gist is included in this guide : http://kivy.org/docs/guide/other-frameworks.html#using-twisted-inside-kivy
Thanks!