Skip to content

Tascalate Concurrent 0.9.2

Compare
Choose a tag to compare
@vsilaev vsilaev released this 21 Sep 20:46
· 45 commits to master since this release

This release contains some code cleanup - separating responsibilities between classes, fixing minor issues, improving performance

  1. ConfigurableDependentPromise now contains only pure wrapper methods, no implementation for default methods (moved to Promise and PromiseHelper classes). It was logically incorrect to have anything but wrapping code in DependentPromise implementation.
  2. ConfigurableDependentPromise and promises originating from onCancel operator are true decorators now - it may be either directly completed/cancelled or via completion/cancellation of the wrapped promise (previously only direct version worked correctly).
  3. CompletableTask is no longer Runnable - separate RunnablePromise interface is introduced and CompletableTask internal subclass is used in ThreadPoolTaskExecutor and alike.
  4. AbstractCompletionStageDecorator decorator now uses CompletionStage as operators' return value, inherited AbstractPromiseLikeDecorator subclass is introduced with overloaded operators returning Promise. This allowed to introduce concrete CompletionStageDecorator and ExecutorBoundCompletionStage classes. The later exists previously, but in different package and copying a lot of code from AbstractCompletionStageDecorator.
  5. JDK version-specific helpers are introduced to correctly delegate CompletionStage calls whenever possible (incl. delegation to the new JDK 12 API methods). WARNING: you need both JDK 12 and JDK 8 to build project locally (JDK 8 is used only for docs).
  6. More efficient implementation of exceptionallyAsync and exceptionallyCompose[Async] is created for Promise implementations (both wrappers and AbstractCompletableTask).
  7. Promises.isCompletedExceptionally method added (as in CompletableFuture).
  8. All internal Promise usages are now CompletableFutureWrapper instead of CompletablePromise - so they never may be completed erroneously outside.
  9. CompletablePromise is extended to be complete CompletableFuture counterpart, incl. explicit completion and similar method from JDK 9 / 12 (complete, completeExceptionally, completeAsync, minimalCompletionStage, minimalCompletionPromise).
  10. Ad-hoc cancellation methods in custom CompletionStage implementations are better supported now (caching lookups, using MethodHandles instead of reflection, etc)
  11. Standardize CompletableFutureWrapper.toCompletableFuture(enlistOrigin) behavior - when returned CompletableFuture cancels original Promise and when it doesn't. Previously this behavior was broken.
  12. Adding non-blocking lock / semaphore / countDownLatch in net.tascalate.concurrent.locks package.
  13. DependentPromise.as_ is renamed to DependentPromise.asʹ (a special char on end).