Are all actions in Play Framework 2 async? Or do I have to use Promises deliberately to achieve this?
To clarify, is the IO (NIO) performed on a different thread than the actual action logic?
It depends on what you mean by asynchronous.
All Play actions are non-blocking in the sense that the IO thread that accepts the HTTP request is not the same as the one that runs the action, and never blocks waiting the action to complete. So yes, (HTTP) IO are performed on a different thread than the actual action logic.
Though, the actions themselves can contain computations that may take a while. Thus they may block the thread they are executed in. That's often the case when you perform database operations, because most database drivers are blocking.
AsyncResults, which [you can create easily](playframework.com/documentation/2.1.1/ScalaAsync]. Same thing with everything else. it is not async, it just gives you the tools to easily use async stuff. - Carstenscala.concurrent.Futures. - Carsten