Class ReactiveStreamsAdapters


  • public final class ReactiveStreamsAdapters
    extends java.lang.Object
    A set of adapter methods for converting to and from Reactive Streams APIs and ServiceTalk APIs.
    • Method Detail

      • fromReactiveStreamsPublisher

        public static <T> Publisher<T> fromReactiveStreamsPublisher​(org.reactivestreams.Publisher<T> source)
        Converts the passed Publisher to a Reactive Streams Publisher.
        Type Parameters:
        T - Type of items emitted from the source and the returned Publisher.
        Parameters:
        source - Publisher to convert to a Publisher.
        Returns:
        A Publisher representation of the passed Publisher.
      • toReactiveStreamsPublisher

        public static <T> org.reactivestreams.Publisher<T> toReactiveStreamsPublisher​(Publisher<T> publisher)
        Converts the passed Publisher to a Reactive Streams Publisher.
        Type Parameters:
        T - Type of items emitted from the source and the returned Publisher.
        Parameters:
        publisher - Publisher to convert to a Publisher.
        Returns:
        A Publisher representation of the passed Publisher.
      • toReactiveStreamsPublisher

        public static <T> org.reactivestreams.Publisher<T> toReactiveStreamsPublisher​(PublisherSource<T> source)
        Converts the passed PublisherSource to a Reactive Streams Publisher.
        Type Parameters:
        T - Type of items emitted from the source and the returned Publisher.
        Parameters:
        source - PublisherSource to convert to a Publisher.
        Returns:
        A Publisher representation of the passed PublisherSource.
      • toReactiveStreamsPublisher

        public static <T> org.reactivestreams.Publisher<T> toReactiveStreamsPublisher​(Single<T> source)
        Converts the passed Single to a Reactive Streams Publisher.
        Type Parameters:
        T - Type of items emitted from the source and the returned Publisher.
        Parameters:
        source - Single to convert to a Publisher.
        Returns:
        A Publisher representation of the passed Single.
      • toReactiveStreamsPublisher

        public static <T> org.reactivestreams.Publisher<T> toReactiveStreamsPublisher​(SingleSource<T> source)
        Converts the passed SingleSource to a Reactive Streams Publisher.
        Type Parameters:
        T - Type of items emitted from the source and the returned Publisher.
        Parameters:
        source - SingleSource to convert to a Publisher.
        Returns:
        A Publisher representation of the passed SingleSource.
      • toReactiveStreamsPublisher

        public static <T> org.reactivestreams.Publisher<T> toReactiveStreamsPublisher​(Completable source)
        Converts the passed Completable to a Reactive Streams Publisher.
        Type Parameters:
        T - Type of items emitted from the source and the returned Publisher.
        Parameters:
        source - Completable to convert to a Publisher.
        Returns:
        A Publisher representation of the passed Completable.
      • toReactiveStreamsPublisher

        public static <T> org.reactivestreams.Publisher<T> toReactiveStreamsPublisher​(CompletableSource source)
        Converts the passed CompletableSource to a Reactive Streams Publisher.
        Type Parameters:
        T - Type of items emitted from the source and the returned Publisher.
        Parameters:
        source - CompletableSource to convert to a Publisher.
        Returns:
        A Publisher representation of the passed CompletableSource.