Tascalate Concurrent 0.9.2
This release contains some code cleanup - separating responsibilities between classes, fixing minor issues, improving performance
ConfigurableDependentPromisenow contains only pure wrapper methods, no implementation for default methods (moved toPromiseandPromiseHelperclasses). It was logically incorrect to have anything but wrapping code inDependentPromiseimplementation.ConfigurableDependentPromiseand promises originating fromonCanceloperator 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).CompletableTaskis no longerRunnable- separateRunnablePromiseinterface is introduced andCompletableTaskinternal subclass is used inThreadPoolTaskExecutorand alike.AbstractCompletionStageDecoratordecorator now usesCompletionStageas operators' return value, inheritedAbstractPromiseLikeDecoratorsubclass is introduced with overloaded operators returningPromise. This allowed to introduce concreteCompletionStageDecoratorandExecutorBoundCompletionStageclasses. The later exists previously, but in different package and copying a lot of code fromAbstractCompletionStageDecorator.- JDK version-specific helpers are introduced to correctly delegate
CompletionStagecalls 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
exceptionallyAsyncandexceptionallyCompose[Async]is created forPromiseimplementations (both wrappers andAbstractCompletableTask). Promises.isCompletedExceptionallymethod added (as inCompletableFuture).- All internal
Promiseusages are nowCompletableFutureWrapperinstead ofCompletablePromise- so they never may be completed erroneously outside. CompletablePromiseis extended to be completeCompletableFuturecounterpart, incl. explicit completion and similar method from JDK 9 / 12 (complete,completeExceptionally,completeAsync,minimalCompletionStage,minimalCompletionPromise).- Ad-hoc cancellation methods in custom
CompletionStageimplementations are better supported now (caching lookups, using MethodHandles instead of reflection, etc) - Standardize
CompletableFutureWrapper.toCompletableFuture(enlistOrigin)behavior - when returnedCompletableFuturecancels originalPromiseand when it doesn't. Previously this behavior was broken. - Adding non-blocking lock / semaphore / countDownLatch in
net.tascalate.concurrent.lockspackage. DependentPromise.as_is renamed toDependentPromise.asʹ(a special char on end).