Manager
flask_worker.Manager
class flask_worker.Manager(app=None, **kwargs) [source]
Flask extension which manages workers. The manager tracks an application import path, a redis connection, the application database, and the web socket. These tools will be invoked by workers.
Parameters: | app : flask.app.Flask or None, default=None
Flask application for whose workers the manager is responsible. If the app is passed to the contructor, the manager will be initialized with the application. Otherwise, you must perform the initialization later by calling You can set the manager's attributes by passing them as keyword arguments. |
---|---|
Attributes: | app_import : str, default='app.app'
Pythonic import path for the Flask application. e.g. if your application object is created in a file
Redis connection for the workers. If not explicitly set, the manager will set the connection attribute to the app's Database for the flask application. loading_img_blueprint : str or None, default=None
Name of the blueprint to which the loading image belongs. If
Name of the loading image file. This should be in the app's
Loading image source path, derived from Socket object through which workers will emit job progress messages. While this argument is not required on initialization, it must be set before the app is run. template : str, default='worker/worker_loading.html'Name of the html template file for the loading page. Flask-Worker provides a default loading template. |
Methods
init_app(self, app, **kwargs) [source]
Initialize the manager with the application.
Parameters: | app : flask.app.Flask
Flask application for whose workers the manager is responsible. **kwargs :You can set the manager's attributes by passing them as keyword arguments. |
---|