Skip to content

Changes included in this release:

  • ListenableFuture API changes from PR #248

    • ListenableFuture.addCallback/addListener replaced with callback and listener which now return this for a more functional style
    • Added ListenableFuture.resultCallback(Consumer<T>) and ListenableFuture.failureCallback(Consumer<Throwable>) as replacements to the classes AbstractFutureCallback(Result|Failure)Handler and FutureCallback(Result|Failure)Handler. This should be a bit more concise and allows for potential optimizations when only one type is needed. In addition we can also deprecate FutureCallbackExceptionHandlerAdapter since ExceptionHandler already extends Consumer<Throwable>, allowing them to be provided directly into failureCallback.
  • Added statics to ImmediateResultListenableFuture:

    • EMPTY_STRING_RESULT provides the String ""
    • EMPTY_OPTIONAL_RESULT provides Optional.empty()
    • EMPTY_LIST_RESULT provides Collections.emptyList()
    • EMPTY_MAP_RESULT provides Collections.emptyMap()
    • EMPTY_SORTED_MAP_RESULT provides Collections.emptySortedMap()
    • EMPTY_SET_RESULT provides Collections.emptySet()
    • EMPTY_SORTED_SET_RESULT provides Collections.emptySortedSet()
    • EMPTY_ITERATOR_RESULT provides Collections.emptyIterator()
    • EMPTY_LIST_ITERATOR_RESULT provides Collections.emptyListIterator()
    • EMPTY_ENUMERATION_RESULT provides Collections.emptyEnumeration()
  • FutureUtils.immediateResultFuture will now provide the above static's for the cases of Optional.empty(), Boolean.TRUE/FALSE, and the empty String. Other cases are still not optimized due to impact seen in benchmarks.

  • Improvements to FutureUtils when an empty Collection is provided. The resulting future now being the EMPTY_LIST_RESULT result described above.

Assets 4
You can’t perform that action at this time.