[Twisted-Python] cReactor fixes
glyph at twistedmatrix.com
Sun Jan 5 20:52:46 EST 2003
On Sun, Jan 05, 2003 at 02:34:10PM -0800, Brian Warner wrote:
> Another possibility which might be easier to implement would be to enforce
> the no-restart restriction, but also create IReactorCore.reset(), and declare
> that it will return the reactor to the state it had at boot time, allowing
> .run() to be called on it once again. This method would also remove all
> DelayedCall events, remove any TCP/UDP sockets or listening ports, delete any
> systemEventTriggers that were added, and generally get rid of any other state
> which might have accumulated since startup. We could have the test suite use
> this to reset the reactor just after each test.
This is definitely the way it should work.
Thanks, Brian, for taking the time to analyze the existing cReactor code in so
much depth. I really owe you one. I will need more time to fully read and
comprehend the rest of the message, but this part has been on my personal TODO
list for a while.
Ideally, I'd prefer that the reactor is *always* in a consistent state. That
would probably involve redefining or removing the "crash" facility, since there
would only be "pause and return so that run() continues" or "stop properly so
run() restarts". Whatever compromise you come up with in this vein is probably
| <`'> | Glyph Lefkowitz: Traveling Sorcerer |
| < _/ > | Lead Developer, the Twisted project |
| < ___/ > | http://www.twistedmatrix.com |
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 189 bytes
Desc: not available
Url : http://twistedmatrix.com/pipermail/twisted-python/attachments/20030105/2baa4199/attachment.pgp
More information about the Twisted-Python