Flask Documentation (1.1.x)
Celery( app.import_name, backend=app.config['CELERY_RESULT_BACKEND'], broker=app.config['CELERY_BROKER_URL'] ) celery.conf.update(app.config) class ContextTask(celery.Task): = ContextTask return celery The function creates a new Celery object, configures it with the broker from the application config, updates the rest of the Celery config from the Flask config and then Let’s write a task that adds two numbers together and returns the result. We configure Celery’s broker and backend to use Redis, create a celery application using the factor from above, and then use it0 码力 | 428 页 | 895.98 KB | 1 年前3Flask Documentation (1.1.x)
make_celery(app): celery = Celery( app.import_name, backend=app.config['CELERY_RESULT_BACKEND'], broker=app.config['CELERY_BROKER_URL'] ) celery.conf.update(app.config) class ContextTask(celery.Task): def __call__(self Task = ContextTask return celery The function creates a new Celery object, configures it with the broker from the application config, updates the rest of the Celery config from the Flask config and then Let’s write a task that adds two numbers together and returns the result. We configure Celery’s broker and backend to use Redis, create a celery application using the factor from above, and then use it0 码力 | 291 页 | 1.25 MB | 1 年前3
共 2 条
- 1
相关搜索词