[TransWarp] Stopping peak.running.scheduler.UntwistedReactor

Yaroslav Samchuk yarcat at ank-sia.com
Thu Jul 10 16:58:14 EDT 2003


I have an application, that uses 
peak.running.scheduler.UntwistedReactor. There are some readers and 
writers registered in this reactor, but there could be a situation, when 
no more readers, writer and laters left - so there is nothing to 
proceed. And this is the point, reactor must be terminated, I suppose...

So, my question is - what is the correct way to stop 
peak.running.scheduler.UntwistedReactor in the described situation? Is 
it a bug or a feature, that reactor continue to work either in case of 
no selectables (as well as laters) left?

My solution was to override this reactor and to check readers, writers 
and laters on every iteration in reactor's run() method and if there are 
no any of them I just say self.stop(). Is it a correct way to terminate 
reactor in case of nothing to proceed or may be there is another way to 
do it, but I don't see it?

Best regards,
Yaroslav Samchuk

More information about the PEAK mailing list