Interface ReactiveExecutionFlow<T>

Type Parameters:
T - The value type
All Superinterfaces:
io.micronaut.core.execution.ExecutionFlow<T>

@Internal public sealed interface ReactiveExecutionFlow<T> extends io.micronaut.core.execution.ExecutionFlow<T>
The reactive execution flow. NOTE: The flow is expected to produce only one result.
Since:
4.0.0
  • Method Summary

    Modifier and Type
    Method
    Description
    static <K> @NonNull ReactiveExecutionFlow<K>
    async(@NonNull Executor executor, @NonNull Supplier<io.micronaut.core.execution.ExecutionFlow<K>> supplier)
    Create a new reactive flow by invoking a supplier asynchronously.
    static <K> @NonNull ReactiveExecutionFlow<K>
    fromFlow(@NonNull io.micronaut.core.execution.ExecutionFlow<K> flow)
    Creates a new reactive flow from other flow.
    static <K> @NonNull ReactiveExecutionFlow<K>
    fromPublisher(@NonNull org.reactivestreams.Publisher<K> publisher)
    Creates a new reactive flow from a publisher.
    static <K> @NonNull io.micronaut.core.execution.ExecutionFlow<K>
    fromPublisherEager(@NonNull org.reactivestreams.Publisher<K> publisher, @NonNull io.micronaut.core.propagation.PropagatedContext propagatedContext)
    Creates a new reactive flow from a publisher.
    @NonNull org.reactivestreams.Publisher<T>
    Returns the reactive flow represented by a publisher.
    static <K> @NonNull org.reactivestreams.Publisher<K>
    toPublisher(@NonNull io.micronaut.core.execution.ExecutionFlow<K> flow)
    Convert the given flow to a reactive publisher.
    static <K> @NonNull org.reactivestreams.Publisher<K>
    toPublisher(@NonNull Supplier<@NonNull io.micronaut.core.execution.ExecutionFlow<K>> flowSupplier)
    Convert the given flow to a reactive publisher.

    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

    • fromPublisher

      @NonNull static <K> @NonNull ReactiveExecutionFlow<K> fromPublisher(@NonNull @NonNull org.reactivestreams.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

      @NonNull static <K> @NonNull io.micronaut.core.execution.ExecutionFlow<K> fromPublisherEager(@NonNull @NonNull org.reactivestreams.Publisher<K> publisher, @NonNull @NonNull io.micronaut.core.propagation.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

      @NonNull static <K> @NonNull ReactiveExecutionFlow<K> async(@NonNull @NonNull Executor executor, @NonNull @NonNull Supplier<io.micronaut.core.execution.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

      @NonNull static <K> @NonNull ReactiveExecutionFlow<K> fromFlow(@NonNull @NonNull io.micronaut.core.execution.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 @NonNull org.reactivestreams.Publisher<T> toPublisher()
      Returns the reactive flow represented by a publisher.
      Returns:
      The publisher
    • toPublisher

      @NonNull @SingleResult static <K> @NonNull org.reactivestreams.Publisher<K> toPublisher(@NonNull @NonNull Supplier<@NonNull io.micronaut.core.execution.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

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