Package io.micronaut.core.execution
Interface DelayedExecutionFlow<T>
- Type Parameters:
T- The type of this flow
- All Superinterfaces:
ExecutionFlow<T>
ExecutionFlow that can be completed similar to a
CompletableFuture.-
Method Summary
Modifier and TypeMethodDescriptionvoidComplete this flow normally.default voidComplete the flow with value / exception.voidComplete this flow with an exception.voidcompleteFrom(@NonNull ExecutionFlow<T> flow) Complete this flow from the given flow.static <T> DelayedExecutionFlow<T> create()booleanCheck for cancellation.voidAdd a listener that is called if this flow or any downstream flow is cancelled.booleantryComplete(@Nullable T result) Complete this flow normally.booleanComplete this flow with an exception.Methods inherited from interface io.micronaut.core.execution.ExecutionFlow
cancel, completeTo, flatMap, map, onComplete, onErrorResume, putInContext, putInContextIfAbsent, then, timeout, toCompletableFuture, tryComplete, tryCompleteError, tryCompleteValue
-
Method Details
-
create
-
complete
Complete this flow normally.- Parameters:
result- The result value
-
completeExceptionally
Complete this flow with an exception.- Parameters:
exc- The exception
-
tryComplete
Complete this flow normally.- Parameters:
result- The result value- Returns:
falseif this flow has already been completed
-
tryCompleteExceptionally
Complete this flow with an exception.- Parameters:
exc- The exception- Returns:
falseif this flow has already been completed
-
isCancelled
boolean isCancelled()Check for cancellation.- Returns:
trueiff this flow or any downstream flow has been cancelled- Since:
- 4.8.0
-
onCancel
Add a listener that is called if this flow or any downstream flow is cancelled.- Parameters:
hook- The hook to call on cancellation- Since:
- 4.8.0
-
completeFrom
Complete this flow from the given flow.- Parameters:
flow- The input flow- Since:
- 4.7.0
-
complete
Complete the flow with value / exception.- Parameters:
value- The valuethrowable- The exception- Since:
- 4.7.0
-