Class SerializedProcessor<I,​O>

  • Type Parameters:
    I - the type of item from upstream
    O - the type of item propagated to the downstream
    All Implemented Interfaces:
    java.util.concurrent.Flow.Processor<I,​O>, java.util.concurrent.Flow.Publisher<O>, java.util.concurrent.Flow.Subscriber<I>

    public class SerializedProcessor<I,​O>
    extends java.lang.Object
    implements java.util.concurrent.Flow.Processor<I,​O>
    Wraps a processor into a serialized version of this processor.
    • Constructor Summary

      Constructors 
      Constructor Description
      SerializedProcessor​(java.util.concurrent.Flow.Processor<I,​O> actual)
      Constructor that wraps an actual processor.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void dispatch​(java.util.List<java.lang.Object> queue, java.util.concurrent.Flow.Subscriber<I> subscriber)
      Dispatches the events contained in the queue to the given subscriber.
      void onComplete()  
      void onError​(java.lang.Throwable t)  
      void onNext​(I item)  
      void onSubscribe​(java.util.concurrent.Flow.Subscription s)  
      void subscribe​(java.util.concurrent.Flow.Subscriber<? super O> downstream)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • SerializedProcessor

        public SerializedProcessor​(java.util.concurrent.Flow.Processor<I,​O> actual)
        Constructor that wraps an actual processor.
        Parameters:
        actual - the subject wrapped
    • Method Detail

      • subscribe

        public void subscribe​(java.util.concurrent.Flow.Subscriber<? super O> downstream)
        Specified by:
        subscribe in interface java.util.concurrent.Flow.Publisher<I>
      • onSubscribe

        public void onSubscribe​(java.util.concurrent.Flow.Subscription s)
        Specified by:
        onSubscribe in interface java.util.concurrent.Flow.Subscriber<I>
      • onNext

        public void onNext​(I item)
        Specified by:
        onNext in interface java.util.concurrent.Flow.Subscriber<I>
      • onError

        public void onError​(java.lang.Throwable t)
        Specified by:
        onError in interface java.util.concurrent.Flow.Subscriber<I>
      • onComplete

        public void onComplete()
        Specified by:
        onComplete in interface java.util.concurrent.Flow.Subscriber<I>
      • dispatch

        public void dispatch​(java.util.List<java.lang.Object> queue,
                             java.util.concurrent.Flow.Subscriber<I> subscriber)
        Dispatches the events contained in the queue to the given subscriber.
        Parameters:
        queue - the queue of event
        subscriber - the subscriber to emit the events to