Internal Refactoring & Bug Fixing
Features
DependentPromise changes
DependentPromisenow is an interfaceConfigurableDependentPromiseis an implementation ofDependentPromise-- it provides support for both explicit (available previously) and implicit (new functionality) enlistment of origins
Promise changes
Promise.dependent(implicitlyEnlistDependency)is added to let create a variant of promise that implicitly enlists dependency (previously only explicit enlistments via additional argument was possible)Promise.raw()method is added to return aPromisethat is free from any behavior decorators (likeConfigurableDependentPromise)
Helper classes
- Adapters and decorators hierarchy has been revisited to provide classes that simplifies implementation of custom decorators / adapters
Re-tryable polling support
Promises.poll(runnable, executor, retryPolicy)is renamed toPromises.retry(runnable, executor, retryPolicy)Promises.poll(callable, executor, retryPolicy)is complemented byPromises.retry(callable, executor, retryPolicy)
The naming now reflects the purpose:retrymethods are keep executing until no exception is thrown (even if method returnsnullresult),poll/pollOptionalare executed unless result (non-null or non-emptyOptional) is returned.
Bug fixes
Minor bug fixing for timeout-related methods (in some places boolean constants was used instead of method-supplied arguments)