Class FlowableHelper

java.lang.Object
io.vertx.rxjava3.FlowableHelper

public class FlowableHelper extends Object
Author:
Julien Viet
  • Constructor Details

    • FlowableHelper

      public FlowableHelper()
  • Method Details

    • nullObserver

      public static <T> FlowableSubscriber<T> nullObserver()
      Returns:
      a FlowableSubscriber that does nothing
    • toReadStream

      public static <T> ReadStream<T> toReadStream(Flowable<T> observable)
      Adapts an RxJava Flowable<T> to a Vert.x ReadStream<T>. The returned readstream will be subscribed to the Flowable<T>.

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

      public static <T,U> Flowable<U> toFlowable(ReadStream<T> stream, Function<T,U> mapping)
      Like toFlowable(ReadStream) but with a mapping function
    • toFlowable

      public static <T> Flowable<T> toFlowable(ReadStream<T> stream)
      Adapts a Vert.x ReadStream<T> to an RxJava Flowable<T>. After the stream is adapted to a flowable, the original stream handlers should not be used anymore as they will be used by the flowable adapter.

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

      public static <T> Flowable<T> toFlowable(ReadStream<T> stream, long maxBufferSize)
      Adapts a Vert.x ReadStream<T> to an RxJava Flowable<T>. After the stream is adapted to a flowable, the original stream handlers should not be used anymore as they will be used by the flowable adapter.

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

      public static <T> Flowable<T> toFlowable(Supplier<Future<ReadStream<T>>> supplier)
      Adapts a Vert.x ReadStream<T> to an RxJava Flowable<T>. After the stream is adapted to a flowable, the original stream handlers should not be used anymore as they will be used by the flowable adapter.

      Parameters:
      supplier - the supplier of future of stream
      Returns:
      the adapted observable
    • unmarshaller

      public static <T> FlowableTransformer<Buffer,T> unmarshaller(Class<T> mappedType)
    • unmarshaller

      public static <T> FlowableTransformer<Buffer,T> unmarshaller(TypeReference<T> mappedTypeRef)
    • unmarshaller

      public static <T> FlowableTransformer<Buffer,T> unmarshaller(Class<T> mappedType, ObjectCodec mapper)
    • unmarshaller

      public static <T> FlowableTransformer<Buffer,T> unmarshaller(TypeReference<T> mappedTypeRef, ObjectCodec mapper)