Interface ReactiveExecutionFlow<T>

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

@Internal public sealed interface ReactiveExecutionFlow<T> extends ExecutionFlow<T>
The reactive execution flow. NOTE: The flow is expected to produce only one result.
Since:
4.0.0
Author:
Denis Stepnov
  • Method Details

    • fromPublisher

      static <K> @NonNull ReactiveExecutionFlow<K> fromPublisher(@NonNull Publisher<K> publisher)
      Creates a new reactive flow from a publisher.
      Type Parameters:
      K - THe flow value type
      Parameters:
      publisher - The publisher
      Returns:
      a new flow
    • fromPublisherEager

      static <K> @NonNull ExecutionFlow<K> fromPublisherEager(@NonNull Publisher<K> publisher, @NonNull PropagatedContext propagatedContext)
      Creates a new reactive flow from a publisher. This method eagerly subscribes to the publisher, and may return an immediate ExecutionFlow if possible.
      Type Parameters:
      K - The flow value type
      Parameters:
      publisher - The publisher
      propagatedContext - A context to propagate in the reactor context and as a thread-local in the subscribe operation.
      Returns:
      a new flow
      Since:
      4.8.0
    • async

      static <K> @NonNull ReactiveExecutionFlow<K> async(@NonNull Executor executor, @NonNull Supplier<ExecutionFlow<K>> supplier)
      Create a new reactive flow by invoking a supplier asynchronously.
      Type Parameters:
      K - The flow value type
      Parameters:
      executor - The executor
      supplier - The supplier
      Returns:
      a new flow
    • fromFlow

      static <K> @NonNull ReactiveExecutionFlow<K> fromFlow(@NonNull ExecutionFlow<K> flow)
      Creates a new reactive flow from other flow.
      Type Parameters:
      K - THe flow value type
      Parameters:
      flow - The flow
      Returns:
      a new flow
    • toPublisher

      @NonNull Publisher<T> toPublisher()
      Returns the reactive flow represented by a publisher.
      Returns:
      The publisher
    • toPublisher

      @SingleResult static <K> @NonNull Publisher<K> toPublisher(@NonNull Supplier<@NonNull ExecutionFlow<K>> flowSupplier)
      Convert the given flow to a reactive publisher. The supplier is called for every subscription to the publisher.
      Type Parameters:
      K - The element type
      Parameters:
      flowSupplier - The flow supplier
      Returns:
      The publisher
    • toPublisher

      @SingleResult static <K> @NonNull Publisher<K> toPublisher(@NonNull ExecutionFlow<K> flow)
      Convert the given flow to a reactive publisher.
      Type Parameters:
      K - The element type
      Parameters:
      flow - The flow
      Returns:
      The publisher