How to process a request in the background and later report the result?

I need to perform a time-consuming task when the user clicks a button. Basically, I’ll be doing some processing on every post, sending requests to a remote server for many.

The user won’t need the result immediately, so I can run it in the background. But I need to be able to tell the user whether the task has finished yet or not (and the result if finished) when they visit that page again. Additionally, I don’t want them to be able to start another instance of the same task (by clicking the button) while the first one is still running.

Any way I can do all of the above?

Read more here: How to process a request in the background and later report the result?

Leave a Reply

Your email address will not be published. Required fields are marked *