Releases: vsilaev/tascalate-concurrent
Tascalate Concurrent 0.9.10
Tascalate Concurrent 0.9.9
- Modify
ContextVarAPI to supportScopedValuefrom JDK 21 - Update build plugins
Tascalate Concurrent 0.9.8
Fix Cancel methods cache (don't prevent classes from being garbage collected, avoid double-lookups of methods due to broken concurrency)
Tascalate Concurrent 0.9.7
Relax type restrictions in Promises.partitioned and PromiseOperations.partitioned*** -- the source entries' type and the spawner-s return value type may be different.
Tascalate Concurrent 0.9.6
- Refactoring promise customizers for context vars and blocking io
- Fixing errors with NIO classes in
net.tascalate.concurrent.io
Tascalate Concurrent 0.9.5
Adding net.tascalate.concurrent.io package with the following functionality:
- Drop-in replacement for
java.nio.channels.AsynchronousChannelimplementations likeAsynchronousFileChannel,AsynchronousServerSocketChannel,AsynchronousSocketChannel. BlockingIOclass that helps create interruptible code that uses blockingjava.io.InputStream,java.io.OutputStream,java.net.HttpUrlConnectionand alike.
Tascalate Concurrent 0.9.4
Minor release with the following changes:
- Fix issue Unexpected cancellation behavior - now onTimeout / orTimeout methods with
cancelOnTimeout = truecorrectly and timely cancelsPromiseeven when used withExecutorhaving limited number of free threads (even in case of single-thread executor). However, the behavior may still be surprising forcancelOnTimeout = falsecase, while we always have to switch back to to the originalExecutorafter timeout (and if it has no free threads, then switching thread context is impossible). - Simplified
CallbackRegistryand related code inAbstractCompletableTask. - Fix error propagation in
CompletablePromise, fix cancellation ofcompleteAsyncresult (should not complete theCompletablePromise).
Tascalate Concurrent 0.9.3
This minor update has the following changes:
- Simplified
Promise.onCancelimplementation (no need for internal extra classes, just std.whenCompletehandler is enough) MultitargetExceptionnow behaves as a standard Java exception (causes are no stored asException.causeandException.suppressedExceptions;Exception.messageprovides meaningful explanation; stack traces works correctly)- Fixed
currentStagecancellation inAsyncLoop - Other minor fixes and refactorings (
PromiseAdapterExtendedsuperclass; simplify dependencies betweenAbstractCompletableTaskand subclasses; move responsibilities betweenTimeoutsandPromiseHelperetc)
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).
Tascalate Concurrent 0.9.1
This release REPLACES 0.9.0 - the previous one is broken due to severe error in Promises.retry functionality as well as due to breaking changes in Promises.atLeast that should be done in major (0.x) release.
The changes are:
- Critical fix:
Promises.retryfunctionality now restored (was endless loop if retry fails for the given attempts count) - Critical fix: wrappers of
CompletableFuturenow overridesthenCompose[Async](fn)behavior for cancellation -- now the Promise returned from fn is cancelled as well (same as withCompletableTask). - Critical incompatible change:
Promises.atLeastandPromises.atLeastStrictnow returns only successfully completed promises, same asPromises.allandPromises.any[Strict]. If you need to check positions of successfully completed promises please use new methods:Promises.atLeastOrderedandPromises.atLeastOrderedStrict. Both returns list ofj.u.Optional,nullat corresponding position means thatCompletionStagewas settled with an error, non-nullOptionalcorresponds to result (emptyOptionalmeans that original result wasnull). - Get rid of sneaky-throwing exceptions in timeouts handling and for
AsyncCompletions. Generally,AsyncCompletionsnow works likeCompletableFuture.join()for theIterator / Streamof promises. - Variants of
Promises.any[Strict]andPromises.atLeast[Strict]that acceptsj.u.Mapparameter now returns no more elements than it was requested. - Added
RetryCallable.of/RetryRunnable.ofmethods to simplify conversions ofCallable / Runnable - Added
DelayPolicy.withCustomizerto let insert custom implementations ofDelayPolicywrappers in chained fashion. - Added
DependentPromise.as_with more specific function arg type; - Simplified
RetryContextinternals AggregatingPromisenow cancels remaining promises before firing events - to release resources before using results of theAggregatingPromiseitself; also this class is optimized for several usage scenarios.RetryPolicy.exceptionClassRetryableis overridable now;