On 07:02 pm, fabian.rothfu...@googlemail.com wrote:
Well no, not from multiple threads.
I have only two threads ­ one main thread, which is the Django framework,
and one detached
thread for the reactor, as the reactor itself would be blocking Django.

All Adapters are in Django, and are reaching out to the one reactor in the
thread without threading themselves.
Is this 'allowed' ?

No. You can only call Twisted APIs in a single thread. The thread everything will happen in is the one you call reactor.run() in, so that's the one you have to call all other APIs in. There is one exception, reactor.callFromThread, which you can call from any thread. It lets you schedule another call to happen in the same thread as reactor.run was called in.

Jean-Paul

_______________________________________________
Twisted-Python mailing list
Twisted-Python@twistedmatrix.com
http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python

Reply via email to