playframework
9146493cd22d
Fix example timeout (#7270)
Will Sargent
2 days ago

381 382 383 384 385 386 387 388 389 390 391 381 382 383 384 385 386 387 388 389 390 391
or use [`play.api.libs.concurrent.Futures`](api/scala/play/api/libs/concurrent/Futures.html) trait in the Scala API: ```scala import play.api.libs.concurrent.Futures._
class MyClass @Inject()(implicit futures: Futures) {
class MyController @Inject()(cc: ControllerComponents)(implicit futures: Futures) extends AbstractController(cc) {
def index = Action.async { // withTimeout is an implicit type enrichment provided by importing Futures._ intensiveComputation().withTimeout(1.seconds).map { i => Ok("Got result: " + i)
...
477 478 479 480 481 482 477 478 479 480 481 482
this.executionContext = executionContext; } ... }
```
```
About FluentSend Feedback