Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to create a Promise<Result> play2.0 framework - Java

How to create a Promise<Result> in Play 2.0 framework - Java

I see this link http://www.playframework.org/documentation/2.0.4/JavaAsync. it doesn't contain that much details. do you known any tutorial than refer to me. pls.

like image 422
bdeveloper01 Avatar asked Oct 03 '12 12:10

bdeveloper01


1 Answers

This is new way of creating Promise in Play 2.2

Promise<Boolean> myPromise = Promise.promise(new Function0<Boolean>() {
    public Boolean apply() throws Throwable {
        // TODO - Add Implementation here.
        return Boolean.TRUE;
    }

});
like image 83
Hemant Avatar answered Sep 28 '22 18:09

Hemant