Package csw.database.javadsl
Class AsyncHelper$
java.lang.Object
csw.database.javadsl.AsyncHelper$
A java helper to schedule and execute blocking operations on a dedicated thread pool. This mechanism will prevent any
blocking operation to be scheduled on a thread pool designated for async operations.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final AsyncHelper$
Static reference to the singleton instance of this Scala object. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescription<T> CompletableFuture<T>
managedBlock
(Supplier<T> supplier) The method wraps ForkJoinPool#managedBlock() and executes the provided supplier in a dedicated thread pool for blocking operations
-
Field Details
-
MODULE$
Static reference to the singleton instance of this Scala object.
-
-
Constructor Details
-
AsyncHelper$
public AsyncHelper$()
-
-
Method Details
-
managedBlock
The method wraps ForkJoinPool#managedBlock() and executes the provided supplier in a dedicated thread pool for blocking operations- Parameters:
supplier
- to be scheduled on a thread pool for blocking operations- Returns:
- a CompletableFuture that waits to complete till the supplier is ready to be executedx in the thread pool and produces the result of type T
-