Interface ConnectingOperators<T>

Type Parameters:
T - The type of the elements that the stream emits.
All Known Subinterfaces:
ProcessorBuilder<T,R>, PublisherBuilder<T>

public interface ConnectingOperators<T>
Operators for connecting different graphs together.
  • Method Summary

    Modifier and Type
    Method
    Description
    to(SubscriberBuilder<? super T,? extends R> subscriberBuilder)
    Connect the outlet of this stream to the given SubscriberBuilder graph.
    to(org.reactivestreams.Subscriber<? super T> subscriber)
    Connect the outlet of the Publisher built by this builder to the given Subscriber.
    via(ProcessorBuilder<? super T,? extends R> processorBuilder)
    Connect the outlet of the Publisher built by this builder to the given ProcessorBuilder.
    via(org.reactivestreams.Processor<? super T,? extends R> processor)
    Connect the outlet of this stream to the given Processor.
  • Method Details

    • to

      ProducesResult<Void> to(org.reactivestreams.Subscriber<? super T> subscriber)
      Connect the outlet of the Publisher built by this builder to the given Subscriber. The Reactive Streams specification states that a subscriber should cancel any new stream subscription it receives if it already has an active subscription. The returned result of this method is a stream that creates a subscription for the subscriber passed in, so the resulting stream should only be run once. For the same reason, the subscriber passed in should not have any active subscriptions and should not be used in more than one call to this method.
      Parameters:
      subscriber - The subscriber to connect.
      Returns:
      A completion builder that completes when the stream completes.
    • to

      <R> ProducesResult<R> to(SubscriberBuilder<? super T,? extends R> subscriberBuilder)
      Connect the outlet of this stream to the given SubscriberBuilder graph. The Reactive Streams specification states that a subscriber should cancel any new stream subscription it receives if it already has an active subscription. For this reason, a subscriber builder, particularly any that represents a graph that includes a user supplied Subscriber or Processor stage, should not be used in the creation of more than one stream instance.
      Parameters:
      subscriberBuilder - The subscriber builder to connect.
      Returns:
      A completion builder that completes when the stream completes.
    • via

      <R> ConnectingOperators<R> via(ProcessorBuilder<? super T,? extends R> processorBuilder)
      Connect the outlet of the Publisher built by this builder to the given ProcessorBuilder. The Reactive Streams specification states that a subscribing processor should cancel any new stream subscription it receives if it already has an active subscription. For this reason, a processor builder, particularly any that represents a graph that includes a user supplied Processor stage, should not be used in the creation of more than one stream instance.
      Parameters:
      processorBuilder - The processor builder to connect.
      Returns:
      A stream builder that represents the passed in processor's outlet.
    • via

      <R> ConnectingOperators<R> via(org.reactivestreams.Processor<? super T,? extends R> processor)
      Connect the outlet of this stream to the given Processor. The Reactive Streams specification states that a subscribing processor should cancel any new stream subscription it receives if it already has an active subscription. The returned result of this method is a stream that creates a subscription for the processor passed in, so the resulting stream should only be run once. For the same reason, the processor passed in should not have any active subscriptions and should not be used in more than one call to this method.
      Parameters:
      processor - The processor builder to connect.
      Returns:
      A stream builder that represents the passed in processor builder's outlet.