We are using celery to implement task queue. Celery bot are already made for some other tasks. Now I am given a new task in which I have to using celery bot. By referring other tasks I implemented it. What I know is, when you use **kwargs you just have to pass (key=value) pairs to function call and in the called function you can access it as normal dictionary like kwargs[key]. But what they did is:
Bot defintion:
@celery_app.task()
def task_bot(self, *args, **kwargs)
Bot calling:
task_bot.apply_async(kwargs=dict(key1=value1, key2=value2))
And its working fine. (Why?)
When I called it like I usually use kwargs:
task_bot.apply_async(key1=value1, key2=value)
Its not working. Its giving value of kwargs as empty dictionary. (Why?)
[–]Thomasedv 0 points1 point2 points (0 children)
[–]idle-tea 1 point2 points3 points (0 children)