Class FluxProcessor<IN,OUT>

java.lang.Object
reactor.core.publisher.Flux<OUT>
reactor.core.publisher.FluxProcessor<IN,OUT>
Type Parameters:
IN - the input value type
OUT - the output value type
All Implemented Interfaces:
Processor<IN,OUT>, Publisher<OUT>, Subscriber<IN>, CorePublisher<OUT>, CoreSubscriber<IN>, Disposable, Scannable
Direct Known Subclasses:
DirectProcessor, EmitterProcessor, ReplayProcessor, UnicastProcessor

@Deprecated public abstract class FluxProcessor<IN,OUT> extends Flux<OUT> implements Processor<IN,OUT>, CoreSubscriber<IN>, Scannable, Disposable
Deprecated.
Processors will be removed in 3.5. Prefer using Sinks.Many instead, or see https://github.com/reactor/reactor-core/issues/2431 for alternatives
A base processor that exposes Flux API for Processor. Implementors include UnicastProcessor, EmitterProcessor, ReplayProcessor.
Author:
Stephane Maldini
  • Constructor Details

    • FluxProcessor

      public FluxProcessor()
      Deprecated.
  • Method Details

    • switchOnNext

      @Deprecated public static <T> FluxProcessor<Publisher<? extends T>,T> switchOnNext()
      Deprecated.
      should use Sinks, Sinks.Many.asFlux() and Flux.switchOnNext(Publisher). To be removed in 3.5.0.
      Build a FluxProcessor whose data are emitted by the most recent emitted Publisher. The Flux will complete once both the publishers source and the last switched to Publisher have completed.

      Type Parameters:
      T - the produced type
      Returns:
      a FluxProcessor accepting publishers and producing T
    • wrap

      public static <IN, OUT> FluxProcessor<IN,OUT> wrap(Subscriber<IN> upstream, Publisher<OUT> downstream)
      Deprecated.
      Transform a receiving Subscriber and a producing Publisher in a logical FluxProcessor. The link between the passed upstream and returned downstream will not be created automatically, e.g. not subscribed together. A Processor might choose to have orthogonal sequence input and output.
      Type Parameters:
      IN - the receiving type
      OUT - the producing type
      Parameters:
      upstream - the upstream subscriber
      downstream - the downstream publisher
      Returns:
      a new blackboxed FluxProcessor
    • dispose

      public void dispose()
      Deprecated.
      Description copied from interface: Disposable
      Cancel or dispose the underlying task or resource.

      Implementations are required to make this method idempotent.

      Specified by:
      dispose in interface Disposable
    • downstreamCount

      public long downstreamCount()
      Deprecated.
      Return the number of active Subscriber or -1 if untracked.
      Returns:
      the number of active Subscriber or -1 if untracked
    • getBufferSize

      public int getBufferSize()
      Deprecated.
      Return the processor buffer capacity if any or Integer.MAX_VALUE
      Returns:
      processor buffer capacity if any or Integer.MAX_VALUE
    • getError

      public @Nullable Throwable getError()
      Deprecated.
      Current error if any, default to null
      Returns:
      Current error if any, default to null
    • hasDownstreams

      public boolean hasDownstreams()
      Deprecated.
      Return true if any Subscriber is actively subscribed
      Returns:
      true if any Subscriber is actively subscribed
    • hasCompleted

      public final boolean hasCompleted()
      Deprecated.
      Return true if terminated with onComplete
      Returns:
      true if terminated with onComplete
    • hasError

      public final boolean hasError()
      Deprecated.
      Return true if terminated with onError
      Returns:
      true if terminated with onError
    • inners

      public Stream<? extends Scannable> inners()
      Deprecated.
      Description copied from interface: Scannable
      Return a Stream of referenced inners (flatmap, multicast etc)
      Specified by:
      inners in interface Scannable
      Returns:
      a Stream of referenced inners (flatmap, multicast etc)
    • isTerminated

      public boolean isTerminated()
      Deprecated.
      Has this upstream finished or "completed" / "failed" ?
      Returns:
      has this upstream finished or "completed" / "failed" ?
    • isSerialized

      public boolean isSerialized()
      Deprecated.
      Return true if this FluxProcessor supports multithread producing
      Returns:
      true if this FluxProcessor supports multithread producing
    • scanUnsafe

      public @Nullable Object scanUnsafe(Scannable.Attr key)
      Deprecated.
      Description copied from interface: Scannable
      This method is used internally by components to define their key-value mappings in a single place. Although it is ignoring the generic type of the Scannable.Attr key, implementors should take care to return values of the correct type, and return null if no specific value is available.

      For public consumption of attributes, prefer using Scannable.scan(Attr), which will return a typed value and fall back to the key's default if the component didn't define any mapping.

      Specified by:
      scanUnsafe in interface Scannable
      Parameters:
      key - a Scannable.Attr to resolve for the component.
      Returns:
      the value associated to the key for that specific component, or null if none.
    • currentContext

      public Context currentContext()
      Deprecated.
      Description copied from interface: CoreSubscriber
      Request a Context from dependent components which can include downstream operators during subscribing or a terminal Subscriber.
      Specified by:
      currentContext in interface CoreSubscriber<IN>
      Returns:
      a resolved context or Context.empty()
    • serialize

      public final FluxProcessor<IN,OUT> serialize()
      Deprecated.
      Create a FluxProcessor that safely gates multi-threaded producer Subscriber.onNext(Object).

      Discard Support: The resulting processor discards elements received from the source Publisher (if any) when it cancels subscription to said source.

      Returns:
      a serializing FluxProcessor
    • sink

      @Deprecated public final FluxSink<IN> sink()
      Deprecated.
      To be removed in 3.5, prefer clear cut usage of Sinks through the Sinks.many() spec.
      Create a FluxSink that safely gates multi-threaded producer Subscriber.onNext(Object). This processor will be subscribed to that FluxSink, and any previous subscribers will be unsubscribed.

      The returned FluxSink will not apply any FluxSink.OverflowStrategy and overflowing FluxSink.next(Object) will behave in two possible ways depending on the Processor:

      • an unbounded processor will handle the overflow itself by dropping or buffering
      • a bounded processor will block/spin
      Returns:
      a serializing FluxSink
    • sink

      @Deprecated public final FluxSink<IN> sink(FluxSink.OverflowStrategy strategy)
      Deprecated.
      To be removed in 3.5, prefer clear cut usage of Sinks through the Sinks.many() spec.
      Create a FluxSink that safely gates multi-threaded producer Subscriber.onNext(Object). This processor will be subscribed to that FluxSink, and any previous subscribers will be unsubscribed.

      The returned FluxSink will not apply any FluxSink.OverflowStrategy and overflowing FluxSink.next(Object) will behave in two possible ways depending on the Processor:

      • an unbounded processor will handle the overflow itself by dropping or buffering
      • a bounded processor will block/spin on IGNORE strategy, or apply the strategy behavior
      Parameters:
      strategy - the overflow strategy, see FluxSink.OverflowStrategy for the available strategies
      Returns:
      a serializing FluxSink
    • serializeAlways

      protected boolean serializeAlways()
      Deprecated.
      Returns serialization strategy. If true, sink() will always be serialized. Otherwise sink is serialized only if FluxSink.onRequest(java.util.function.LongConsumer) is invoked.
      Returns:
      true to serialize any sink, false to delay serialization till onRequest
    • isIdentityProcessor

      protected boolean isIdentityProcessor()
      Deprecated.
      Return true if FluxProcessor<T, T>
      Returns:
      true if FluxProcessor<T, T>