private void handleLoadFromUserDataService ( final User loadedUser , final Callback < List < Recommendation > > recommendationsCallback ) { /** Add a runnable to the callbacks list. */ callbacks . add ( ( ) -> { List < Recommendation > recommendations = runRulesEngineAgainstUser ( loadedUser ) ; recommendationsCallback . accept ( recommendations ) ; } ) ; // callbacks.add(new Runnable() { // @Override // public void run() { // List<Recommendation> recommendations = runRulesEngineAgainstUser(loadedUser); // recommendationsCallback.accept(recommendations); // } // }); }
Handle defered recommendations based on user loads .