Package: org.apache.groovy.reactor

## [Java] Class ReactorAwaitableAdapter

- org.apache.groovy.reactor.ReactorAwaitableAdapter

- All Implemented Interfaces and Traits:
    AwaitableAdapter

      public class ReactorAwaitableAdapter
      extends Object
      implements AwaitableAdapter

  Adapter for Project Reactor types, enabling:

  - `await mono` — awaits a single-value reactor.core.publisher.Mono
  - `for await (item in flux)` — iterates over a reactor.core.publisher.Flux

  Auto-discovered via ServiceLoader when `groovy-reactor` is on the classpath.

  Since:
    6.0.0

- - ### Methods Summary

    Methods
    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.

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class Object` | `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Method Detail

    - #### public boolean supportsAwaitable(Class<?> type)

      Returns whether the supplied type can be awaited as a Reactor single-result source.

      Parameters:
        `type` - candidate type to inspect
      Returns:
        `true` if `type` is a reactor.core.publisher.Mono or one of its subtypes

    - #### public boolean supportsIterable(Class<?> type)

      Returns whether the supplied type can be exposed as an iterable Reactor multi-result source.

      Parameters:
        `type` - candidate type to inspect
      Returns:
        `true` if `type` is a reactor.core.publisher.Flux or one of its subtypes

    - #### <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().

      throws:
        IllegalArgumentException if `source` is not a reactor.core.publisher.Mono
      Parameters:
        `source` - source object to adapt
      Type Parameters:
        `T` - awaited value type
      Returns:
        awaitable representation of the supplied reactor.core.publisher.Mono

    - #### <T> public Iterable<T> toIterable(Object source)

      Converts a reactor.core.publisher.Flux into a blocking Iterable suitable for `for await` consumption.

      throws:
        IllegalArgumentException if `source` is not a reactor.core.publisher.Flux
      Parameters:
        `source` - source object to adapt
      Type Parameters:
        `T` - iterated element type
      Returns:
        iterable view of the supplied reactor.core.publisher.Flux