Twisted application runner.

Method __init__
Method run Run this command.
Method killIfRequested If self.kill is true, attempt to kill a running instance of the application.
Method startLogging Start the twisted.logger logging system.
Method startReactor If self.reactor is None, install the default reactor and set self.reactor to the default reactor.
Method whenRunning Call self.whenRunning.
Method reactorExited Call self.reactorExited.
def __init__(self, reactor=None, pidFile=nonePIDFile, kill=False, defaultLogLevel=LogLevel.info, logFile=stderr, fileLogObserverFactory=textFileLogObserver, whenRunning=lambda _: None, whenRunningArguments={}, reactorExited=lambda _: None, reactorExitedArguments={}): (source)
ParametersreactorThe reactor to start and run the application in. (type: IReactorCore)
pidFileThe file to store the running process ID in. (type: callable that takes a single writable file-like object argument and returns a twisted.logger.FileLogObserver)
killWhether this runner should kill an existing running instance of the application. (type: bool)
defaultLogLevelThe default log level to start the logging system with. (type: constantly.NamedConstant from LogLevel)
logFileA file stream to write logging output to. (type: writable file-like object)
fileLogObserverFactoryA factory for the file log observer to use when starting the logging system.
whenRunningHook to call after the reactor is running; this is where the application code that relies on the reactor gets called. (type: callable that takes the keyword arguments specified by whenRunningArguments)
whenRunningArgumentsKeyword arguments to pass to whenRunning when it is called. (type: dict)
reactorExitedHook to call after the reactor exits. (type: callable that takes the keyword arguments specified by reactorExitedArguments)
reactorExitedArgumentsKeyword arguments to pass to reactorExited when it is called. (type: dict)
def run(self): (source)

Run this command.

def killIfRequested(self): (source)

If self.kill is true, attempt to kill a running instance of the application.

def startLogging(self): (source)

Start the twisted.logger logging system.

def startReactor(self): (source)

If self.reactor is None, install the default reactor and set self.reactor to the default reactor.

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.

NoteThis method is called after the reactor starts running.
def reactorExited(self): (source)

Call self.reactorExited.

NoteThis method is called after the reactor exits.
API Documentation for Twisted, generated by pydoctor at 2017-06-11 10:59:01.