I am trying to get celery tasks wrapper around a python object method. Like:
class A:
@task
def test_task(self,args):
print "BLah..test"
def main():
a= A()
args = {}
a.test_task(args)
Now this fails with error test_task takes atleast 2 arguments (1 given). My understanding is the self object is not getting passed. Why is this so? and how do i work around this?
Update: It really was my lack of understanding of celery. the @task decorator is just to add/handle the celery task related parameters. it doesn't automatically make every call to the function a celery task. the function must be called as a.test_task.delay(args).. therein the problem...