[Twisted-Python] reactor.running?
One thing that seems to be missing since the move to reactors is twisted.internet.main.running -- a flag you can check to see if the reactor is running or not. I notice that at least the default reactor has a .running attribute. Should I use this? Should it be documented? I suspect that I actually want a different solution to my problem. Here's the situation: I have called clientTCP to connect a Protocol to a remote server. I want the ClientFactory to *not* start a new protocol if the reactor is shutting down (which it currently does, because the shutdown process closes the connected Protocol, triggering a reconnect...). Thoughts? -Andrew.
Andrew Bennetts wrote:
I notice that at least the default reactor has a .running attribute. Should I use this? Should it be documented?
Don't use it. If it's important maybe we should a isRunning() method to the API.
I suspect that I actually want a different solution to my problem. Here's the situation: I have called clientTCP to connect a Protocol to a remote server. I want the ClientFactory to *not* start a new protocol if the reactor is shutting down (which it currently does, because the shutdown process closes the connected Protocol, triggering a reconnect...).
I'll take this as a use case for the client TCP refactor.h
participants (2)
-
Andrew Bennetts
-
Itamar Shtull-Trauring