title: How to prevent task marking as success on return [celery]
body: <p>I have a task like this</p>
  
  <pre><code>@celery.task(bind=True, max_retries = 5)
  def send_notification_task(self, user_id, content):
      print 'Sending message to pubnub'
  
      msg = prepare_message(16182 , 16182, 'Android', 'This is a text message')  
  
      def _callback(message):
          print 'success callback'  
          print(message)
  
      def _error(message):
          print 'error callback'  
          print self.request.retries
          print self
          countdown = int(random.uniform(2, 4) ** self.request.retries)
          print countdown
          raise self.retry(countdown=countdown)
  
      publish('16182', msg, _callback, _error)
  
      print 'returning success to celery'
  
      current_task.update_state(state='PROGRESS', meta={'description': 'Doing some task', 'current': 59, 'tota': 73})
  </code></pre>
  
  <p>Here, I want to mark the task as success / failure only in callback methods i.e. success or failure. However, a task is marked as success as soon as this function returns (publish is an async call in itself.)</p>
  
  <p>How can I handle this?</p>
  
  <p>I have already tried marking the task as <code>PROGRESS</code> as the last line.</p>