Process AJAX response with long runing tasks
Posted
by
mpz
on Stack Overflow
See other posts from Stack Overflow
or by mpz
Published on 2012-10-20T12:27:34Z
Indexed on
2012/10/20
23:01 UTC
Read the original article
Hit count: 173
I have long time task in controller action.
I use delayed job for it. (Also in heroku it is good practice for perfomance - dyno must work for small time in each request)
But my client need result of it work and users can wait on that task. It is more clear: no any addition models or records in it, simple view and js...
I think about such way:
- On client run AJAX with very long timeout (5 min for example)
- Client make request to server as usual
- On controller in action1 def start_work (with delay work setup) i need NO any response to client
- After work performs (delay job finished) i need run new action2 with response to client
- Client recieve response after about 1-5 min
It is possible?
© Stack Overflow or respective owner