Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where is the job support in Play 2.0?

In Play 1.0, we can define some jobs which will be executed in the background:

@OnApplicatonStart
@Every("1h")
public class DataJob extends Job {
    public void doJob() {
       // ...
    }
}

But I can't find it in Play 2.0. Do I miss something?

like image 491
Freewind Avatar asked Feb 18 '12 08:02

Freewind


People also ask

Which component is responsible for building play framework?

Play Framework is an open-source web application framework which follows the model–view–controller (MVC) architectural pattern. It is written in Scala and usable from other programming languages that are compiled to JVM bytecode, e.g. Java.

Is Play framework still used?

Play is rock-solid and used by hundreds of thousands of Java and Scala developers every month. Play is still extremely relevant to today's application and web development and has a passionate and very capable community around it ensuring that it has many good years left.

What is play framework used for?

Play Framework makes it easy to build web applications with Java & Scala. Play is based on a lightweight, stateless, web-friendly architecture. Built on Akka, Play provides predictable and minimal resource consumption (CPU, memory, threads) for highly-scalable applications.


1 Answers

You could use the scheduler service in akka.

http://doc.akka.io/docs/akka/2.0/java/scheduler.html

http://doc.akka.io/docs/akka/2.0/scala/scheduler.html

Basically you create an actor that executes your logic if it receives a certain message.

like image 76
Dominik Dorn Avatar answered Oct 13 '22 12:10

Dominik Dorn