Class JdkFlowAdapters


  • public final class JdkFlowAdapters
    extends java.lang.Object
    A set of adapter methods for converting to and from JDK Flow APIs and ServiceTalk APIs.
    • Method Detail

      • fromFlowPublisher

        public static <T> Publisher<T> fromFlowPublisher​(java.util.concurrent.Flow.Publisher<T> source)
        Converts the passed Publisher to a JDK Flow Flow.Publisher.
        Type Parameters:
        T - Type of items emitted from the source and the returned Publisher.
        Parameters:
        source - Flow.Publisher to convert to a Publisher.
        Returns:
        A Publisher representation of the passed Flow.Publisher.
      • toFlowPublisher

        public static <T> java.util.concurrent.Flow.Publisher<T> toFlowPublisher​(Publisher<T> publisher)
        Converts the passed Publisher to a JDK Flow Flow.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 Flow.Publisher representation of the passed Publisher.
      • toFlowPublisher

        public static <T> java.util.concurrent.Flow.Publisher<T> toFlowPublisher​(PublisherSource<T> source)
        Converts the passed PublisherSource to a JDK Flow Flow.Publisher.
        Type Parameters:
        T - Type of items emitted from the source and the returned Flow.Publisher.
        Parameters:
        source - PublisherSource to convert to a Flow.Publisher.
        Returns:
        A Flow.Publisher representation of the passed PublisherSource.