Skip to content

Releases: vsilaev/tascalate-concurrent

New Promise API methods; Overriding default async executor; Optimizations + Bug fixes

27 Mar 08:56
3528948
Compare
Choose a tag to compare

Bug fixes

The release contains single but very important bug fix - DependentPromise interface now correctly overrides methods inherited from CompletionStage (with DependentPromise as a return type, previously it was Promise)

Optimizations

  • Avoid using of CompletableFuture wrappers inside internal code - use CompletableFuture class itself
  • Optimize edge-cases for Promises.any / anyStrict / atLeast / atLeastStrict
  • Refactor common code used internally into separate internal utility class to minimize inter-relations between classes.
  • Better wrapper for custom CompletionStage implementation that implements Future interface as well (i.e. prefer delegation wherever possible) -- see CompletionStageWrapper + BlockingCompletionStageAdapter
  • Custom Promise adapter for CompletionStage that adds blocking Future API (previously it was done via implicit creation of CompletableFuture) -- see CompletionStageWrapper

Enhancements and new API

The release adds an option to override default async Executor for Promise. Promise.defaultAsyncOn(Executor) + related adapters serves this purpose. Also, DependentPromise extend this behavior for own declared methods (the ones these let user enlist origins).
Additionally. Promise.join() method is added - technically, it's like a Promise.get() but without throwing checked exceptions.

Bug fixing & Refactoring

16 Mar 13:41
Compare
Choose a tag to compare

The release contains minor bug-fixing and refactorings

  1. AbstractCompletableTask methods handle[Async] and whenComplete[Async] now handles exceptions the same way as CompletableFuture does: any exception in whenComplete[Async] does not override original exception for subsequent stages (though, it's enlisted in addSuppressed); exceptions are wrapped into CompletionException
  2. Optimize edge-cases for Promises.any, Promises.anyStrict and Promises.anyLeast
  3. Refactored code of Promises.from that wraps third-party CompletionStage to Promise
  4. Fixed rounding error with DurationCalcs.safeExtractAmount

Fixing edge-case overflows when working with Duration

15 Mar 17:13
Compare
Choose a tag to compare

Since version 0.6.0 the library uses smallest possible time precision (NANOS) for delays and timeouts.
In edge cases overflow was possible when library converts/re-calculates durations with NANOS precision.

This release mainly address this issue.

Internal Refactoring & Bug Fixing

14 Mar 15:57
0cd63ae
Compare
Choose a tag to compare

Features

DependentPromise changes

  • DependentPromise now is an interface
  • ConfigurableDependentPromise is an implementation of DependentPromise -- it provides support for both explicit (available previously) and implicit (new functionality) enlistment of origins

Promise changes

  • Promise.dependent(implicitlyEnlistDependency) is added to let create a variant of promise that implicitly enlists dependency (previously only explicit enlistments via additional argument was possible)
  • Promise.raw() method is added to return a Promise that is free from any behavior decorators (like ConfigurableDependentPromise)

Helper classes

  • Adapters and decorators hierarchy has been revisited to provide classes that simplifies implementation of custom decorators / adapters

Re-tryable polling support

  • Promises.poll(runnable, executor, retryPolicy) is renamed to Promises.retry(runnable, executor, retryPolicy)
  • Promises.poll(callable, executor, retryPolicy) is complemented by Promises.retry(callable, executor, retryPolicy)
    The naming now reflects the purpose: retry methods are keep executing until no exception is thrown (even if method returns null result), poll / pollOptional are executed unless result (non-null or non-empty Optional) is returned.

Bug fixes

Minor bug fixing for timeout-related methods (in some places boolean constants was used instead of method-supplied arguments)

Polling & Timeout-related functionality

28 Nov 11:51
Compare
Choose a tag to compare

Features

Promise interface is extended with timeout-related methods

  • Promise.onTimeout(delay, [cancelOnTimeout=true])
  • Promise.orTimeout(defaultValue, delay, [cancelOnTimeout=true)
  • Promise.delay(delay, [delayOnError=true])
    Additionally, there is a method to specify initial delay
  • CompletableTask.delay(delay, executor)

Re-tryable polling support

Promises now extended with several methods that allows polling Runnable / Callable according to RetryPolicy until result is available:

  • Promises.poll(runnable, executor, retryPolicy)
  • Promises.poll(callable, executor, retryPolicy)
  • Promises.pollOptional(callableWithOptionalResult executor, retryPolicy)

Easing creation of DependentPromise

Promise now have a dependent() method that converts this Promise to a DependentPromise to allow writing of fluent API chains.

Promises combinators methods now have additional overloads

Promises.all / any / atLeast and corresponding *Strict now overloaded to accept a list of Promise-es in addition to vararg array.

Bug fixes

None

DependentPromise - support for cancellation of Promise origins

01 Aug 14:57
Compare
Choose a tag to compare

Feature: this release introduces new class DependentPromise - a wrapper that may keep track of CompletionStage-s it's originated from. Also, this wrapper will cancel all the origins enlisted.

Feature: additionally, Promises class adds several overload to all, any, atLeast and corresponding *Strict variants to let specify whether or not CompletionStage-s should be cancelled.

Bug fix: AbstractCompletableTask.thenComposeAsync now correctly cancels all intermediate (hidden from client) Promise-s used.

Adding supplyAsync / runAsync as CompletableTask API entry points

25 Jul 16:20
Compare
Choose a tag to compare

Bug-fixing and minor extensions

24 Jul 11:44
Compare
Choose a tag to compare
  1. Fixed an issues with AbstractCompletableTask.whenCompleteAsync(...) -- wrong executor where used in constructor.
  2. Adding Promise.getNow(...) methods

Initial release of the library

21 Jul 15:07
Compare
Choose a tag to compare
0.5

Releasing 0.5