Class VertxContextSupport

java.lang.Object
io.quarkus.vertx.VertxContextSupport

public final class VertxContextSupport extends Object
Provides utility methods to work with Vertx duplicated context.
See Also:
  • VertxContext
  • Method Summary

    Modifier and Type
    Method
    Description
    static <T> void
    subscribe(Supplier<io.smallrye.mutiny.Multi<T>> multiSupplier, Consumer<io.smallrye.mutiny.groups.MultiSubscribe<T>> subscribeConsumer)
    Subscribes to the supplied Multi on a Vertx duplicated context; does not block the current thread.
    static <T> T
    subscribeAndAwait(Supplier<io.smallrye.mutiny.Uni<T>> uniSupplier)
    Subscribes to the supplied Uni on a Vertx duplicated context; blocks the current thread and waits for the result.
    static <T> void
    subscribeWith(Supplier<io.smallrye.mutiny.Multi<T>> multiSupplier, Consumer<? super T> onItem)
    Subscribes to the supplied Multi on a Vertx duplicated context; does not block the current thread.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • subscribeAndAwait

      public static <T> T subscribeAndAwait(Supplier<io.smallrye.mutiny.Uni<T>> uniSupplier) throws Throwable
      Subscribes to the supplied Uni on a Vertx duplicated context; blocks the current thread and waits for the result.

      If it's necessary, the CDI request context is activated during execution of the asynchronous code.

      Parameters:
      uniSupplier -
      Throws:
      IllegalStateException - If called on an event loop thread.
      Throwable
    • subscribe

      public static <T> void subscribe(Supplier<io.smallrye.mutiny.Multi<T>> multiSupplier, Consumer<io.smallrye.mutiny.groups.MultiSubscribe<T>> subscribeConsumer)
      Subscribes to the supplied Multi on a Vertx duplicated context; does not block the current thread.
      Type Parameters:
      T -
      Parameters:
      multiSupplier -
      subscribeConsumer -
    • subscribeWith

      public static <T> void subscribeWith(Supplier<io.smallrye.mutiny.Multi<T>> multiSupplier, Consumer<? super T> onItem)
      Subscribes to the supplied Multi on a Vertx duplicated context; does not block the current thread.
      Type Parameters:
      T -
      Parameters:
      multiSupplier -
      onItem -