Class MultiHelper

java.lang.Object
io.smallrye.mutiny.vertx.MultiHelper

public class MultiHelper extends Object
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static <T> io.smallrye.mutiny.Multi<T>
    toMulti(io.vertx.core.streams.ReadStream<T> stream)
    Adapts a Vert.x io.vertx.core.streams.ReadStream<T> to an Mutiny io.smallrye.mutiny.Multi<T>.
    static <T, U> io.smallrye.mutiny.Multi<U>
    toMulti(io.vertx.core.streams.ReadStream<T> stream, Function<T,U> mapping)
    Like toMulti(ReadStream) but with a mapping function
    static <T> io.vertx.core.streams.ReadStream<T>
    toReadStream(io.smallrye.mutiny.Multi<T> observable)
    Adapts an Mutiny io.smallrye.mutiny.Multi<T> to a Vert.x io.vertx.core.streams.ReadStream<T>.

    Methods inherited from class java.lang.Object

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

    • MultiHelper

      public MultiHelper()
  • Method Details

    • toReadStream

      public static <T> io.vertx.core.streams.ReadStream<T> toReadStream(io.smallrye.mutiny.Multi<T> observable)
      Adapts an Mutiny io.smallrye.mutiny.Multi<T> to a Vert.x io.vertx.core.streams.ReadStream<T>. The returned ReadStream will be subscribed to the io.smallrye.mutiny.Multi<T>.

      Parameters:
      observable - the observable to adapt
      Returns:
      the adapted stream
    • toMulti

      public static <T, U> io.smallrye.mutiny.Multi<U> toMulti(io.vertx.core.streams.ReadStream<T> stream, Function<T,U> mapping)
      Like toMulti(ReadStream) but with a mapping function
    • toMulti

      public static <T> io.smallrye.mutiny.Multi<T> toMulti(io.vertx.core.streams.ReadStream<T> stream)
      Adapts a Vert.x io.vertx.core.streams.ReadStream<T> to an Mutiny io.smallrye.mutiny.Multi<T>. After the stream is adapted to a Multi, the original stream handlers should not be used anymore as they will be used by the Multi adapter.

      Parameters:
      stream - the stream to adapt
      Returns:
      the adapted observable