flask - Is there a way to receive a notification as soon as a certain task with a certain task id is successful or fails using Celery for Python? -


i want know if there way monitor whether or not task completes or fails using python celery. have event want fire based on results of task.

you can run task celery @shared_task try except block inside:

@shared_task def my_task(input1, input2, ...):     setting up...     try:         stuff         fire_success_event() <- success event     except exception:         above stuff failed         fire_fail_event() <- fail event         return 1 <- fail     return 0 <- success 

good luck :)


Comments

Popular posts from this blog

'hasOwnProperty' in javascript -

python - ValueError: No axis named 1 for object type <class 'pandas.core.series.Series'> -

java - How to provide dependency injections in Eclipse RCP 3.x? -