Skip to content
/ deferer Public

Play module to launch methods of your models via TaskQueue

Notifications You must be signed in to change notification settings

Ouziel/deferer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Deferer

Launch any method of your models via a TaskQueue.

Usage

Model

package models;
import models.deferer.ModelTaskInvoker;

public class MyModel extends Model {

@Id

public Long id;

public static MyModel findById(Long id) {
return Model.all(MyModel.class).filter(“id”, id).get();
}

public void myMethod(String param1, Int param2, etc..) {
// execute some application logic here …
}

public void deferMyMethod(String param1, Int param2, etc..) {
ModelTaskInvoker.defer(“queueName”, “MyModel”, “myMethod”, this.id, param1, param2, etc..);
}

public static void myStaticMethod(String param1, Int param2, etc..) {
// execute some application logic here …
}

public void deferMyStaticMethod(String param1, Int param2, etc..) {
ModelTaskInvoker.deferStatic(“queueName”, “MyModel”, “myMethod”, param1, param2, etc..);
}
}

Your model must have a Long Id and a method to find it by this id.
Your methods must have only simple type parameters.

Route for GAE Task

  • / module:deferer

Configuration

application.deferer.task=GAETask
%test.application.deferer.task=MockTask

possible values : GAETask, PlayTask, MockTask

ModelTaskInvoker.classPrefix = “models.”;
ModelTaskInvoker.findByIdMethodName = “findById”;

About

Play module to launch methods of your models via TaskQueue

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published