title: Celery: update state of task when using classes
body: <p>Hi i'm trying to update the state of a method which is executed as a task:</p>
  
  <p>As described in : <a href="http://docs.celeryproject.org/en/latest/reference/celery.contrib.methods.html" rel="nofollow noreferrer">http://docs.celeryproject.org/en/latest/reference/celery.contrib.methods.html</a> </p>
  
  <pre><code>from celery import Celery
  
  celery = Celery()
  
  class A(object):
  
      def __init__(self):
          self.a = 0
  
      @celery.task(filter=task_method)
      def add(self):
           self.a += 10
  
           for i in range(10):
               self.update_state(state="PROGRESS", meta={
                   "current": i, "total": 10, "status": "Sleeping"
               })
  
  
           return {"current": 100, "total": 100, "status": "Complete."}
  
  
  
  a = A()
  a.add.delay()
  </code></pre>
  
  <p>Which gives an error:</p>
  
  <pre><code>AttributeError: 'A' object has no attribute 'update_state'
  </code></pre>
  
  <p>Which seems logical to me since A does not inherit from task, so it hasn't got the "update_task" method.</p>
  
  <p><strong>Question</strong>: How do i update the state of an task when using method based tasks ???</p>
  
  <p><strong>Update</strong>:
  As described in the comments below, updating the status of a task which is
  not bound is impossible, therefore the celery.contrib.methods way of defining methods as tasks is not usable in my example. </p>