Just starting out on Play. The documentation talks about how Play can be run asynchronously.
But how to run MySQL queries when running Play asynchronously? Normal MySQL queries are blocking, right? So that wouldn't work.
Node.js has its own non-blocking MySQL clients just for this purpose, but I can't find anything similar for Play.
How do you run MySQL queries within an asynchronous Play application?
Play Jobs are executed in a separate thread and release the main http thread. The main http thread is then started where it left off when the Job (wrapped in a Promise object) returns after completing.
So, the main http thread is not held up, and can be made available for handling other incoming http requests.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With