I would like to adopt the promise protocol as shown in the docs. The example provided there works but the promise is handled on the worker side. Instead I would like to get notified on the client.
Here is my test.py:
from celery import Celery
app = Celery(broker='amqp://', backend='rpc')
@app.task
def add(x, y):
return x + y
On the client side I'm entering the following commands:
import test
test.add.delay(2, 2).then(lambda: print('OK'))
While googling around I've bump into this so apparently I'm not the only one struggling to understand how it is supposed to work.
My understanding is that once the task has been processed, result should be sent back to the client and then the callback should fire, but that's not the case, my promise never gets resolved.
Is my understanding correct? Is this the desired behaviour?
Thx