我正在使用播放2.6。
我需要做这样的事情:
1-Receive an HTTP request
2-Start a job to insert hundreds of thousands of rows in the Database, which might take hours to complete
3-Return an HTTP response immediately after starting the job
4-Keep the job running and send an email to the user when it's finished
我找到了一些与Akka https://www.playframework.com/documentation/2.6.x/JavaAkka有关的文档,但我不知道这会是吗?我在正确的道路上吗?
return promiseOfResult
而不是return result
以避免阻塞。请注意,默认情况下操作是异步的: