I am new to task queue. When i open the shell and execute the function add.delay(3,4)
from the function in the shell to perform the task. I get : <AsyncResult: 30db3528-5b0f-4e74-bf47-51956a1f83e9>
. How do I get a result from this function and what should i do to schedule the result to be executed 5 second later?
#celery.py
from __future__ import absolute_import, unicode_literals
import os
from celery import Celery
app = Celery('RedisQueue')
app.autodiscover_tasks()
`@app.task
def add(a, b):
return a + b`
#__init__.py
from __future__ import absolute_import, unicode_literals
__all__ = ['celery_app']
#settings.py
CELERY_BROKER_URL = 'redis://localhost:6379'
CELERY_RESULT_BACKEND = 'redis://localhost:6379'
CELERY_ACCEPT_CONTENT = ['application/json']
CELERY_RESULT_SERIALIZER = 'json'
CELERY_TASK_SERIALIZER = 'json'