java - How do I wait and get the result from a Promise in the service layer in Play Framework 2.2.1? -


i need value promise returned method service layer. , need inside action<?> onrequest(request req, method actionmethod){} of global class extends globalsettings. need value returned promise before calling method service layer , before onrequest method of global class returns.

i've method named await can't examples googled method coming from. i'm not sure if method can give me result.

i'm doing in java.

edit: added source code

public class global extends globalsettings {      @autowired     private authorizationservice authorizationservice;      @override     public action<?> onrequest(request req, method actionmethod)      {         // simplicity's sake         string username = req.getheader( "email" );          promise<boolean> promiseofboolean =             this.getauthorizationservice().isuserregistered( username );          if( /* promiseofboolean true */ true )         {             // here             // return new action here             return null;         }         else {                       return super.onrequest(req, actionmethod);         }     }   } 


Comments

Popular posts from this blog

How to access named pipes using JavaScript in Firefox add-on? -

multithreading - OPAL (Open Phone Abstraction Library) Transport not terminated when reattaching thread? -

node.js - req param returns an empty array -