Interface StreamCreator<T>

  • Type Parameters:
    T - the type of data that the stream contains
    Functional Interface:
    This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

    @FunctionalInterface
    public interface StreamCreator<T>
    Interface that represents an entity that is able to create a specific Publisher. The implementations of this interfaces should know a priori the type and how to create a Publisher.
    • Method Detail

      • createWith

        org.reactivestreams.Publisher<T> createWith​(DiscoveryService discoveryService)
        Creates a Publisher. The provided DiscoveryService can be used to discover other Publishers in order to combine them during the creation process.

        NOTE: it is strongly discouraged the use of multiple threads inside this method (see TypedStreamFactory documentation).

        Parameters:
        discoveryService - DiscoveryService which can be used by the factory to look up other streams ('upstream' of the one it will create)
        Returns:
        the newly created Publisher