You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
DeferredManager d = new DefaultDeferredManager();
dman
.when(new DeferredObject().reject(""), new DeferredObject().promise(), new DeferredObject().promise())
.then(new DoneCallback<MultipleResults>()
{
@Override
public void onDone(MultipleResults result)
{
System.out.println("done called");
}
})
.fail(new FailCallback<OneReject>()
{
@Override
public void onFail(OneReject result)
{
System.out.println("fail called");
}
})
.always(new AlwaysCallback<MultipleResults, OneReject>()
{
@Override
public void onAlways(Promise.State state, MultipleResults resolved, OneReject rejected)
{
System.out.println("always called");
}
});
I am noticing that right away onFail gets called and onAlways gets called, since the first promise is rejected. It doesn't matter that all other promises in the chain are pending.
This is fine, but is there any way I can wait for all promises in the deferred manager to resolve/reject? And then collect them all together? I am looking for something similar to when.settle() in when.js
The text was updated successfully, but these errors were encountered:
I currently have code like this:
I am noticing that right away
onFail
gets called andonAlways
gets called, since the first promise is rejected. It doesn't matter that all other promises in the chain are pending.This is fine, but is there any way I can wait for all promises in the deferred manager to resolve/reject? And then collect them all together? I am looking for something similar to
when.settle()
in when.jsThe text was updated successfully, but these errors were encountered: