O'Reilly logo

Play Framework Cookbook - Second Edition by Giancarlo Inductivo, Alexander Reelsen

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Using futures with Akka actors

For this recipe, we will explore how Play Framework allows us to create asynchronous controllers using futures, in conjunction with Akka actors. The ability to create asynchronous controllers provides a way for developers to trigger background jobs and execute long-running operations asynchronously without sacrificing endpoint responsiveness. Adding Akka to the mix brings a new dimension to fault-tolerant, resilient data services, which become valuable tools in a developer's toolchain in the age of maturing and sophisticating web application requirements.

How to do it…

For Java, we need to take the following steps:

  1. Run the foo_java application with Hot-Reloading enabled.
  2. Modify the application controller in foo_java/app/controllers/Application.java ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required