I have a Play app that compiles some code behind the scenes and I was wondering what the best strategy was to first render a "please wait..." message before the job starts and then a "job complete" message once it is finished.
It's not something that can be chunked, it's either done or not, so I'm guessing without using websockets the only way is to poll with ajax?
thanks!
When executing a Job (using .now()
), it returns a Promise object. Using this, you can use the play await
function and ajax (long polling) or web sockets.
So, you would do the following