[Twisted-Python] test if thread is reactor's thread
Thomas Hervé
therve at free.fr
Wed May 11 16:11:27 EDT 2011
Le 11/05/2011 20:18, Alessandro Dentella a écrit :
> Hi,
>
>
> is there a way to test if the thread a function is called is the reactor's
> thread?
>
> I have a function that can be called from the main thread or from the
> reactor's thread and should behave differently...
Hi,
twisted.python.threadable.isInIOThread() should answer to that question.
Regards,
--
Thomas
More information about the Twisted-Python
mailing list