class documentation

class Runner: (source)

View In Hierarchy

Twisted application runner.
Method kill​If​Requested If self._kill is true, attempt to kill a running instance of the application.
Method reactor​Exited Call self._reactorExited with self._reactorExitedArguments.
Method run Run this command.
Method start​Logging Start the twisted.logger logging system.
Method start​Reactor Register self._whenRunning with the reactor so that it is called once the reactor is running, then start the reactor.
Method when​Running Call self._whenRunning with self._whenRunningArguments.
Class Variable _log The logger attached to this class.
Instance Variable _default​Log​Level The default log level to start the logging system with.
Instance Variable _file​Log​Observer​Factory A factory for the file log observer to use when starting the logging system.
Instance Variable _kill Whether this runner should kill an existing running instance of the application.
Instance Variable _log​File A file stream to write logging output to.
Instance Variable _pid​File The file to store the running process ID in.
Instance Variable _reactor The reactor to start and run the application in.
Instance Variable _reactor​Exited Hook to call after the reactor exits.
Instance Variable _reactor​Exited​Arguments Keyword arguments to pass to reactorExited when it is called.
Instance Variable _when​Running Hook to call after the reactor is running; this is where the application code that relies on the reactor gets called.
Instance Variable _when​Running​Arguments Keyword arguments to pass to whenRunning when it is called.
def killIfRequested(self): (source)
If self._kill is true, attempt to kill a running instance of the application.
def reactorExited(self): (source)
Call self._reactorExited with self._reactorExitedArguments.
Note
This method is called after the reactor exits.
def run(self): (source)
Run this command.
def startLogging(self): (source)
Start the twisted.logger logging system.
def startReactor(self): (source)
Register self._whenRunning with the reactor so that it is called once the reactor is running, then start the reactor.
def whenRunning(self): (source)
Call self._whenRunning with self._whenRunningArguments.
Note
This method is called after the reactor starts running.
_log = (source)
The logger attached to this class.
_defaultLogLevel: NamedConstant = (source)
The default log level to start the logging system with.
_fileLogObserverFactory: Callable[[TextIO], FileLogObserver] = (source)
A factory for the file log observer to use when starting the logging system.
_kill: bool = (source)
Whether this runner should kill an existing running instance of the application.
_logFile: TextIO = (source)
A file stream to write logging output to.
_pidFile: IPIDFile = (source)
The file to store the running process ID in.
The reactor to start and run the application in.
_reactorExited: Callable[..., None] = (source)
Hook to call after the reactor exits.
_reactorExitedArguments: Mapping[str, Any] = (source)
Keyword arguments to pass to reactorExited when it is called.
_whenRunning: Callable[..., None] = (source)
Hook to call after the reactor is running; this is where the application code that relies on the reactor gets called.
_whenRunningArguments: Mapping[str, Any] = (source)
Keyword arguments to pass to whenRunning when it is called.