celery/celery — pull request #1812 by kaizoku (2014-01-22 01:09:07+00:00)
Title: Add an signal, sent when task state is updated

Add a signal `task_state`, that gets thrown whenever a task's state is updated.
I wanted to add a handler to get info from my custom progress state.

From a task:
```
@celery.task(bind=True)
def update(self):
for stuff in mystuff:
... do stuff with stuff
self.update_state(
state="PROGRESS",
meta={'current': i, 'total': numtotal}
)

```
```
@task_state.connect
def task_state_handler(sender=None, state="", meta={}, *args, **kwargs):
print "%s sent state: %s with args %s" % (sender, state, meta)
```