Google App Engine: Java version of python lazy library?

Does anyone know about java version of python lazy library? Or maybe the idea of ​​how to implement it?

EDIT: the application has http://code.google.com/appengine/articles/deferred.html , but this library is only for python. I am looking for something similar, but this works with GAE / Java

+3
source share
5 answers

Work on the Java version has been postponed, but nothing has been released. A search in the archives of the google-appengine-java group may reveal some user code that implements this. Keep in mind that this is not as simple as Python - you need to declare a serializable class that implements a specific interface, while in Python almost any function or method will work fine.

+3
source

The lazy library you are referencing relies on the Task Queue API in App Engine. The api task is available in java. However, java as a language does not allow passing functions / methods as arguments in the way python does. Thus, the likelihood that the java version of the deferred library will not look as good as python.

(, - ), - , Deferrable, , , , . , , Queue .

Deferrable , Java python.

, , Deferrable - URL-, . , , . OTOH, , URL.

+2

SDK 1.4.3 adds Java support for deferred tasks .

+2
source

Nah it is only for python, did not find a way to implement it

0
source

There - JDeferred

JDeferred is a Java Deferred / Promise library, similar to a deferred jQuery object.

// deferred object and promise
Deferred deferred = new DeferredObject();
Promise promise = deferred.promise();
promise.done(new DoneCallback() {
  public void onDone(Object result) {
    ...
  }
}).fail(new FailCallback() {
  public void onFail(Object rejection) {
    ...
  }
}).progress(new ProgressCallback() {
  public void onProgress(Object progress) {
    ...
  }
}).always(new AlwaysCallback() {
  public void onAlways(State state, Object result, Object rejection) {
    ...
  }
});

// with the reference to deferred object, you can then trigger actions/updates
deferred.resolve("done");
deferred.reject("oops");
deferred.progress("100%");
0
source

Source: https://habr.com/ru/post/1780061/


All Articles