I have a django backend and I'm trying to poll the status of multiple Celery Tasks (https://docs.celeryq.dev/en/stable/index.html) every 3 seconds.
So for example I have 4 task ids:
- 3099023
- 3493494
- 4309349
- 5498458
So I have to call http.get<...>(backend) every 3 seconds 4 times with each id, until the state of a id is "FINISHED". This should stop the poll of the finished task.
Is there a simple way to do that?
I was trying to do that in a for loop:
- Iterating through my ids
- Create a timer for each id
- In each timer poll the id with a backend http call
- Continue if response of the http call is not finished - otherwise stop