Interface ReactiveExecutionFlow<T>
- Type Parameters:
T
- The value type
- All Superinterfaces:
ExecutionFlow<T>
The reactive execution flow.
NOTE: The flow is expected to produce only one result.
- Since:
- 4.0.0
- Author:
- Denis Stepnov
-
Method Summary
Modifier and TypeMethodDescriptionstatic <K> @NonNull ReactiveExecutionFlow<K>
Create a new reactive flow by invoking a supplier asynchronously.static <K> @NonNull ReactiveExecutionFlow<K>
fromFlow
(@NonNull ExecutionFlow<K> flow) Creates a new reactive flow from other flow.static <K> @NonNull ReactiveExecutionFlow<K>
fromPublisher
(@NonNull Publisher<K> publisher) Creates a new reactive flow from a publisher.static <K> @NonNull ExecutionFlow<K>
fromPublisherEager
(@NonNull Publisher<K> publisher, @NonNull PropagatedContext propagatedContext) Creates a new reactive flow from a publisher.Returns the reactive flow represented by a publisher.toPublisher
(@NonNull ExecutionFlow<K> flow) Convert the given flow to a reactive publisher.toPublisher
(@NonNull Supplier<@NonNull 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 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 ExecutionFlow<K> fromPublisherEager(@NonNull @NonNull Publisher<K> publisher, @NonNull @NonNull PropagatedContext propagatedContext) Creates a new reactive flow from a publisher. This method eagerly subscribes to the publisher, and may return an immediateExecutionFlow
if possible.- Type Parameters:
K
- The flow value type- Parameters:
publisher
- The publisherpropagatedContext
- 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<ExecutionFlow<K>> supplier) Create a new reactive flow by invoking a supplier asynchronously.- Type Parameters:
K
- The flow value type- Parameters:
executor
- The executorsupplier
- The supplier- Returns:
- a new flow
-
fromFlow
@NonNull static <K> @NonNull ReactiveExecutionFlow<K> fromFlow(@NonNull @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
Returns the reactive flow represented by a publisher.- Returns:
- The publisher
-
toPublisher
@NonNull @SingleResult static <K> @NonNull Publisher<K> toPublisher(@NonNull @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
@NonNull @SingleResult static <K> @NonNull Publisher<K> toPublisher(@NonNull @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
-