Package com._1c.g5.v8.dt.common
Interface IEvalCompletableFutureStrategy<T,E extends org.eclipse.core.runtime.CoreException>
- Type Parameters:
T- Generic type of CompletableFuture. E- Type of custom exception if an error occured inevalCompletableFutureGetmethod.
- All Known Subinterfaces:
INonCancelableEvalCompletableFutureStrategy<T,E>
- All Known Implementing Classes:
AbstractWaitingWithInfiniteProgressDialog,WaitForDebugProcessesTerminationStrategy
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@FunctionalInterface
public interface IEvalCompletableFutureStrategy<T,E extends org.eclipse.core.runtime.CoreException>
Strategy for waiting of and getting result of
CompletableFuture.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final longThis constant can be passed as timeout argument inevalCompletableFutureGetif there is no time limit onCompletableFutureresult waiting. -
Method Summary
Modifier and TypeMethodDescriptionevalCompletableFutureGet(CompletableFuture<T> completableFuture, long timeout, TimeUnit timeUnit) Evaluate one of the CompletableFuture::get methods with any additional actions that need to be performed before and after.
-
Field Details
-
INFINITE_TIMEOUT
static final long INFINITE_TIMEOUTThis constant can be passed as timeout argument inevalCompletableFutureGetif there is no time limit onCompletableFutureresult waiting.- See Also:
-
-
Method Details
-
evalCompletableFutureGet
T evalCompletableFutureGet(CompletableFuture<T> completableFuture, long timeout, TimeUnit timeUnit) throws E, TimeoutException, org.eclipse.core.runtime.OperationCanceledException Evaluate one of the CompletableFuture::get methods with any additional actions that need to be performed before and after. - Parameters:
completableFuture- Future which result is need, must not benull.timeout- Future result wait timeout. Must be greater or equal 0 orINFINITE_TIMEOUT.timeUnit- Units oftimeout, can benulliftimeoutis equalINFINITE_TIMEOUT.- Returns:
- result of Completable Future, can be
null. - Throws:
TimeoutException- if there was waiting timeout.org.eclipse.core.runtime.OperationCanceledException- if user cancels operation (where applicable).E extends org.eclipse.core.runtime.CoreException
-