Building workflows with Celery tasks
Utilizing Celery as a task queue manager and Redis as its broker was part of our Chapter 5 content. The chapter explicitly discussed all setups and installations to build Flask-Celery-Redis integration. It also expounded on how Celery can run background processes asynchronously outside the context of Flask’s request-response transaction. Additionally, this chapter will show us another feature of Celery that can solve business process optimization.
Celery has a mechanism to build dynamic workflows, types of workflows that run outside the bounds of some schema definitions and rules from start to end of workflow activities. Its first requirement is to wrap all tasks in signatures.
Creating task signatures
In a typical scenario, calling Celery tasks requires invoking directly its delay()
method to run the underlying process the standard way or apply_async()
to run it asynchronously. But to manage Celery tasks to build custom dynamic...