M
M
Michael Kim2017-02-21 21:20:51
Flask
Michael Kim, 2017-02-21 21:20:51

How to send a response to the client after completing a Celery task?

There is a backend with Flask and Celery. When an http request is made, a task is launched in the route handler. How to return a response to the client upon completion of the task? After all, if you just check the state immediately, it will be 'PENDING', not 'SUCCESS'. And if you check the state in an eternal loop, then the asynchrony is lost, or not?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
iegor, 2017-02-21
@iegor

put something asynchronous next to it and connect it via a websocket. Or ask every 1/5/10 sec. at the flask

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question