from celery import Celery app = Celery(\'tasks\', backend=\'amqp://guest@localhost//\', broker=\'amqp://guest@localhost//\') a_num = 0 @app.task def addone():
The tasks will run asynchronously so every time it starts a new task a_num will be set to 0. They are run as separate instances.
If you want to work with values I suggest a value store or database of some sort.