[Twisted-Python] Using a custom reactor in twisted trial for test cases?

exarkun at twistedmatrix.com exarkun at twistedmatrix.com
Fri Oct 30 10:06:21 EDT 2009

On 09:38 am, cwellington at ccg.murdoch.edu.au wrote:
>Hi there,
>I am using twisted trial to run test cases for an application. The
>application however uses stackless python and has a custom stackless
>reactor. I implemented this reactor like this...

It looks like your custom reactor is mainly in charge of making sure 
stackless.schedule() gets called at least once every 0.1 seconds.  Is 
that right?  If so, a much better approach would be to use 
twisted.internet.task.LoopingCall rather than implementing a custom 

Is there something undesirable about that (much simpler, less fragile) 

As for your actual question, if you want a new reactor to be as usable 
as one of the existing ones, you need to write a plugin declaring its 
available.  Take a look at twisted/plugins/twisted_reactors.py for some 


More information about the Twisted-Python mailing list