Internal Refactoring & Bug Fixing
Features
DependentPromise changes
DependentPromise
now is an interfaceConfigurableDependentPromise
is 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 aPromise
that 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:retry
methods are keep executing until no exception is thrown (even if method returnsnull
result),poll
/pollOptional
are 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)