public class ReactorAwaitableAdapter
extends Object
implements AwaitableAdapter
Adapter for Project Reactor types, enabling:
await mono — awaits a single-value reactor.core.publisher.Monofor await (item in flux) — iterates over a reactor.core.publisher.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 reactor.core.publisher.Mono into an Awaitable backed by the mono's reactor.core.publisher.Mono#toFuture(). |
<T> |
public Iterable<T> |
toIterable(Object source)Converts a reactor.core.publisher.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 reactor.core.publisher.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 reactor.core.publisher.Flux or one of its subtypesConverts a reactor.core.publisher.Mono into an Awaitable backed by the mono's reactor.core.publisher.Mono#toFuture().
source is not a reactor.core.publisher.Monosource - source object to adaptT - awaited value type Converts a reactor.core.publisher.Flux into a blocking Iterable suitable for
for await consumption.
source is not a reactor.core.publisher.Fluxsource - source object to adaptT - iterated element type