Before upgrade to Play 2.5, I remember the docs said (even 2.5 now):
Play recommends using
import play.api.libs.concurrent.Execution.Implicits._
However, when I use the new activator to create Play 2.5 template project, for example
import scala.concurrent.{ExecutionContext, Future, Promise}
import scala.concurrent.duration._
/**
* This controller creates an `Action` that demonstrates how to write
* simple asychronous code in a controller. It uses a timer to
* asynchronously delay sending a response for 1 second.
*
* @param actorSystem We need the `ActorSystem`'s `Scheduler` to
* run code after a delay.
* @param exec We need an `ExecutionContext` to execute our
* asynchronous code.
*/
@Singleton
class AsyncController @Inject() (actorSystem: ActorSystem)(implicit exec: ExecutionContext) extends Controller {
Here, the ExecutionContext is from Scala, my question here is which one we should use. If we use the ExecutionContext provided by Scala, can we get the benefit of Play optimising performance stuff?
Which is pretty confused.