Class AwaitableAdapterRegistry

java.lang.Object
groovy.concurrent.AwaitableAdapterRegistry

public final class AwaitableAdapterRegistry extends Object
Central registry for AwaitableAdapter instances.

On class-load, adapters are discovered via ServiceLoader from META-INF/services/groovy.concurrent.AwaitableAdapter. Two built-in adapters are always present after SPI-loaded ones:

Since:
6.0.0
  • Method Details

    • register

      public static void register(AwaitableAdapter adapter)
      Registers an adapter at the highest priority (before SPI-loaded adapters).
    • unregister

      public static void unregister(AwaitableAdapter adapter)
      Removes a previously registered adapter.
    • toIterable

      public static <T> Iterable<T> toIterable(Object source)
      Converts the given source to an Iterable for for await.