public class ReactorAwaitableAdapter
extends Object
implements AwaitableAdapter
Adapter for Project Reactor types, enabling:
await mono — awaits a single-value Monofor await (item in flux) — iterates over a Flux
Auto-discovered via ServiceLoader when groovy-reactor
is on the classpath.
| Type Params | Return Type | Name and description |
|---|---|---|
|
public boolean |
supportsAwaitable(Class<?> type)Returns whether the supplied type can be awaited as a Reactor single-result source. |
|
public boolean |
supportsIterable(Class<?> type)Returns whether the supplied type can be exposed as an iterable Reactor multi-result source. |
<T> |
public Awaitable<T> |
toAwaitable(Object source)Converts a Mono into an Awaitable backed by the mono's {@linkplain Mono#toFuture() future view}. |
<T> |
public Iterable<T> |
toIterable(Object source)Converts a Flux into a blocking Iterable suitable for for await consumption. |
Returns whether the supplied type can be awaited as a Reactor single-result source.
type - candidate type to inspecttrue if type is a Mono or one of its subtypesReturns whether the supplied type can be exposed as an iterable Reactor multi-result source.
type - candidate type to inspecttrue if type is a Flux or one of its subtypesConverts a Mono into an Awaitable backed by the mono's {@linkplain Mono#toFuture() future view}.
source is not a Monosource - source object to adaptT - awaited value type Converts a Flux into a blocking Iterable suitable for
for await consumption.
source is not a Fluxsource - source object to adaptT - iterated element type