Twisted application runner.

Method __init__
Method run

Run this command. Equivalent to:


Method killIfRequested No summary
Method writePIDFile Write a PID file for this application if RunnerOptions.pidFilePath is specified in self.options.
Method removePIDFile Remove the PID file for this application if RunnerOptions.pidFilePath is specified in self.options.
Method startLogging Start the twisted.logger logging system.
Method startReactor No summary
Method whenRunning If RunnerOptions.whenRunning is specified in self.options, call it.
Method reactorExited If RunnerOptions.reactorExited is specified in self.options, call it.
def __init__(self, options): (source)
ParametersoptionsConfiguration options for this runner. (type: mapping of RunnerOptions to values)
def run(self): (source)

Run this command. Equivalent to:

   self.killIfRequested()
   self.writePIDFile()
   self.startLogging()
   self.startReactor()
   self.reactorExited()
   self.removePIDFile()

Additional steps may be added over time, but the order won't change.

def killIfRequested(self): (source)

Kill a running instance of this application if RunnerOptions.kill is specified and True in self.options. This requires that RunnerOptions.pidFilePath also be specified; exit with ExitStatus.EX_USAGE if kill is requested with no PID file.

def writePIDFile(self): (source)

Write a PID file for this application if RunnerOptions.pidFilePath is specified in self.options.

def removePIDFile(self): (source)

Remove the PID file for this application if RunnerOptions.pidFilePath is specified in self.options.

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 and start the reactor. If RunnerOptions.reactor is specified in self.options, use that reactor; otherwise use the default reactor.

def whenRunning(self): (source)

If RunnerOptions.whenRunning is specified in self.options, call it.

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

If RunnerOptions.reactorExited is specified in self.options, call it.

NoteThis method is called after the reactor has exited.
API Documentation for Twisted, generated by pydoctor at 2016-10-29 16:19:29.