asphalt.core.runner
- asphalt.core.runner.run_application(component, *, event_loop_policy=None, max_threads=None, logging=20, start_timeout=10)
Configure logging and start the given root component in the default asyncio event loop.
Assuming the root component was started successfully, the event loop will continue running until the process is terminated.
- Initializes the logging system first based on the value of
logging: If the value is a dictionary, it is passed to
logging.config.dictConfig()as argument.If the value is an integer, it is passed to
logging.basicConfig()as the logging level.If the value is
None, logging setup is skipped entirely.
By default, the logging system is initialized using
basicConfig()using theINFOlogging level.The default executor in the event loop is replaced with a new
ThreadPoolExecutorwhere the maximum number of threads is set to the value ofmax_threadsor, if omitted, the default value ofThreadPoolExecutor.- Parameters:
component – the root component (either a component instance or a configuration dictionary where the special
typekey is either a component class or amodule:varnamereference to one)event_loop_policy – entry point name (from the
asphalt.core.event_loop_policiesnamespace) of an alternate event loop policy (or a module:varname reference to one)max_threads – the maximum number of worker threads in the default thread pool executor (the default value depends on the event loop implementation)
logging – a logging configuration dictionary, logging level or
Nonestart_timeout – seconds to wait for the root component (and its subcomponents) to start up before giving up (
None= wait forever)
- Initializes the logging system first based on the value of