This library includes classes for managing tasks.
FutureTracker class
The class tracks futures and when needed tries to wait for them.
Queue with maximum task capacity, maximum total task data capacity and retry scheduler. Queue does not allow new tasks to exceed capacity limitations.
Task extraction order is determined by their schedule time, that is task with earlier schedule time will be extracted before the task with later schedule time. For equal schedule times no particular order is guarantied.
Task extraction does not free up resources in queue. They are reserved for future retries. Resources are only released on task completion.
A task whose payload size exceeds the maximum data size is accepted only when the queue holds no data. It then occupies the whole data capacity until it is completed, and other submissions wait for it.
-
The release includes BROKEN changes related to
BlockingScheduledRetryableTaskQueueclass:- The
void submit(ScheduledRetryableTask<V> task)method can throw InterruptedException. A blocked submission can now be interrupted, for example on shutdown.
- The
-
Fixed:
BlockingScheduledRetryableTaskQueue.submit()blocked forever when task's payload size exceeded max data size (#53). Such task is now accepted when the queue holds no data and occupies the whole data capacity until it is completed. -
BlockingScheduledRetryableTaskQueue.setMaxDataSize()wakes up blockedsubmit()calls so that they re-check capacity against the new value. -
Updated:
- th2 gradle plugin:
0.3.15(from0.2.4) - junit-bom:
5.14.4(from5.12.1) - assertj-core:
3.27.7(from3.27.3)
- th2 gradle plugin:
-
The release includes BROKEN changes related to
FutureTrackerclass:- The
boolean track(CompletableFuture<T> future)method can throw InterruptedException. - The
void awaitRemaining()andawaitRemaining(long timeoutMillis)methods can throw InterruptedException.
- The
-
Provided ability to limit capacity of
FutureTrackerclass -
Added
FutureTracker.createUnlimited()andFutureTracker.create(int limit)factory methods -
Added
boolean track(CompletableFuture<T> future, Duration timeout)overload method inFutureTrackerclass. -
Added
void awaitRemaining(Duration timeout)overload method inFutureTrackerclass. -
Added
int limit()method intoFutureTrackerclass. -
Added
boolean hasLimit()method intoFutureTrackerclass. -
Added
boolean isEnabled()method intoFutureTrackerclass.