class twisted.application.app.ApplicationRunner: (source)
Known subclasses: twisted.scripts._twistd_unix.UnixApplicationRunner, twisted.scripts._twistw.WindowsApplicationRunner
An object which helps running an application based on a config object.
Subclass me and implement preApplication and postApplication methods. postApplication generally will want to run the reactor after starting the application.
Instance Variable | config | The config object, which provides a dict-like interface. |
Instance Variable | application | Available in postApplication, but not preApplication. This is the application object. |
Instance Variable | profilerFactory | Factory for creating a profiler object, able to profile the application if options are set accordingly. |
Instance Variable | profiler | Instance provided by profilerFactory . |
Instance Variable | loggerFactory | Factory for creating object responsible for logging. |
Instance Variable | logger | Instance provided by loggerFactory . |
Method | __init__ | Undocumented |
Method | run | Run the application. |
Method | startReactor | Run the reactor with the given configuration. Subclasses should probably call this from postApplication . |
Method | preApplication | Override in subclass. |
Method | postApplication | Override in subclass. |
Method | createOrGetApplication | Create or load an Application based on the parameters found in the given ServerOptions instance. |
Instance Variable | _exitSignal | Undocumented |
Run the reactor with the given configuration. Subclasses should probably call this from postApplication
.
See Also | runReactorWithLogging |
Override in subclass.
This should set up any state necessary before loading and running the Application.
Override in subclass.
This will be called after the application has been loaded (so the application
attribute will be set). Generally this should start the application and run the reactor.
Create or load an Application based on the parameters found in the given ServerOptions
instance.
If a subcommand was used, the service.IServiceMaker
that it represents will be used to construct a service to be added to a newly-created Application.
Otherwise, an application will be loaded based on parameters in the config.