[TransWarp] Stopping
peak.running.scheduler.UntwistedReactor
Phillip J. Eby
pje at telecommunity.com
Fri Jul 11 12:08:55 EDT 2003
At 11:47 AM 7/11/03 -0400, Phillip J. Eby wrote:
>At 04:39 PM 7/11/03 +0300, alexander smishlajev wrote:
>>Phillip J. Eby wrote:
>>>To be honest, I had never considered such a possibility, as every
>>>application scenario I envisioned for using the reactor either has an
>>>explicit shutdown command occurring, is explicitly time-bound (periodic
>>>task runner), or is a "run forever" loop.
>>
>>are there any scenarios where reactor running without readers, writers
>>and queued tasks makes sense?
>
>Only multi-threaded scenarios, where another thread is running at the same
>time as the (empty) reactor loop. A quick question, though... if you use
>a Twisted reactor instead of the PEAK reactor, does *it* shut down?
Looking over Twisted's code, it doesn't appear that there is 1) any
automatic shutdown, or 2) any official way to tell whether a reactor has
any selectables. Without one of these, I can't make an automatic shutdown
mechanism that is still interface-compatible with Twisted.
Probably the best thing for us to do is take this question to the Twisted
developers. If we can't get an agreement as to how to establish an
auto-shutdown mechanism, there are probably ways to wrap an adapter around
Twisted's reactors that would enable the mechanism. But first it would be
best to see if this can be officially added to Twisted.
More information about the PEAK
mailing list