[Twisted-Python] Twisted and python-ogre
thomas.boucher at student.ecp.fr
Thu Feb 14 10:32:30 EST 2008
I am currently part of a MMORPG project in python, using Twisted
and python-ogre. I found some posts talking about the cohabitation
between the two. However I couldn't find a definitive answer. What I am
seeking for is more a general method than technical details.
What I would like to do is to put properly Twisted and python-ogre
together. To do that I have already tried the following ways :
- First run python-ogre in the main loop. At a time, this loop launches
the twisted reactor in another thread with Thread(target =
The problem I am experiencing is described here . The sendLine method
is executed immediately, but the data is received by the other side only
20/30 seconds after.
- So I tried not to run Twisted in another thread, by using the way
described here . Twisted is given the main loop and the
rendering is done frame by frame with the coiterate. It works sometimes,
the renderOneFrame in the coiterration is not really working.
But it seems more logical to run ptyhon-ogre in the main loop and
twisted on the side (in another thread for example, as soon as the
client has decided to connect to the server). Have you any ideas how I
could do this properly (with threads, without threads, with the
If Twisted was originally made for MMORPGs, why the reactor wants so
much to be in the main loop and to manage itself the other threads (with
callInThread for example)?
More information about the Twisted-Python