Interface ImperativeExecutionFlow<T>

Type Parameters:
T - The value type
All Superinterfaces:
ExecutionFlow<T>

@Internal public interface ImperativeExecutionFlow<T> extends ExecutionFlow<T>
The imperative execution flow.
Since:
4.0.0
Author:
Denis Stepnov
  • Method Details

    • getValue

      @Nullable T getValue()
      Returns:
      The value if present
    • getError

      @Nullable Throwable getError()
      Returns:
      The exception if present
    • getContext

      @NonNull Map<String,Object> getContext()
      Returns:
      The context if present
    • tryComplete

      default @NonNull ImperativeExecutionFlow<T> tryComplete()
      Description copied from interface: ExecutionFlow
      Create an ImperativeExecutionFlow from this execution flow, if possible. The flow will have its result immediately available.
      Specified by:
      tryComplete in interface ExecutionFlow<T>
      Returns:
      The imperative flow, or null if this flow is not complete or does not support this operation
    • timeout

      @Deprecated default @NonNull ExecutionFlow<T> timeout(@NonNull Duration timeout, @NonNull ScheduledExecutorService scheduler, @Nullable BiConsumer<T,Throwable> onDiscard)
      Deprecated.
      This method has no effect for ImperativeExecutionFlow, it makes no sense to use it
      Create a new ExecutionFlow that either returns the same result or, if the timeout expires before the result is received, a TimeoutException.
      Specified by:
      timeout in interface ExecutionFlow<T>
      Parameters:
      timeout - The timeout
      scheduler - Scheduler to schedule the timeout task
      onDiscard - An optional consumer to be called on the value of this flow if the flow completes after the timeout has expired and thus the value is discarded
      Returns:
      A new flow that will produce either the same value or a TimeoutException