Tascalate Concurrent 0.9.2
This release contains some code cleanup - separating responsibilities between classes, fixing minor issues, improving performance
ConfigurableDependentPromise
now contains only pure wrapper methods, no implementation for default methods (moved toPromise
andPromiseHelper
classes). It was logically incorrect to have anything but wrapping code inDependentPromise
implementation.ConfigurableDependentPromise
and promises originating fromonCancel
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).CompletableTask
is no longerRunnable
- separateRunnablePromise
interface is introduced andCompletableTask
internal subclass is used inThreadPoolTaskExecutor
and alike.AbstractCompletionStageDecorator
decorator now usesCompletionStage
as operators' return value, inheritedAbstractPromiseLikeDecorator
subclass is introduced with overloaded operators returningPromise
. This allowed to introduce concreteCompletionStageDecorator
andExecutorBoundCompletionStage
classes. The later exists previously, but in different package and copying a lot of code fromAbstractCompletionStageDecorator
.- 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). - More efficient implementation of
exceptionallyAsync
andexceptionallyCompose[Async]
is created forPromise
implementations (both wrappers andAbstractCompletableTask
). Promises.isCompletedExceptionally
method added (as inCompletableFuture
).- All internal
Promise
usages are nowCompletableFutureWrapper
instead ofCompletablePromise
- so they never may be completed erroneously outside. CompletablePromise
is extended to be completeCompletableFuture
counterpart, incl. explicit completion and similar method from JDK 9 / 12 (complete
,completeExceptionally
,completeAsync
,minimalCompletionStage
,minimalCompletionPromise
).- Ad-hoc cancellation methods in custom
CompletionStage
implementations are better supported now (caching lookups, using MethodHandles instead of reflection, etc) - Standardize
CompletableFutureWrapper.toCompletableFuture(enlistOrigin)
behavior - when returnedCompletableFuture
cancels originalPromise
and when it doesn't. Previously this behavior was broken. - Adding non-blocking lock / semaphore / countDownLatch in
net.tascalate.concurrent.locks
package. DependentPromise.as_
is renamed toDependentPromise.asʹ
(a special char on end).