Release 0.2.2
Minor improvements.
- Removed excessive synchronization from
Promise
. In particular, it no longer executes alien code (then
callbacks) within itssynchronized
blocks, as this is fragile and deadlock-prone (Effective Java item 67). Locks are now only held strictly as necessary. - Reject callbacks are now declared as
throws Throwable
rather thanthrows Exception
. This makes the "execute cleanup code and rethrow" idiom more natural to express inthenApply
andthenAccept
:
promise.thenApply(result -> { ... }, exception -> {
loadingIndicator.hide();
submitButton.enable();
throw exception;
});