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:
    org.reactivestreams.Processor<I,​O>, org.reactivestreams.Publisher<O>, org.reactivestreams.Subscriber<I>

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

      Constructors 
      Constructor Description
      SerializedProcessor​(org.reactivestreams.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, org.reactivestreams.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​(org.reactivestreams.Subscription s)  
      void subscribe​(org.reactivestreams.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​(org.reactivestreams.Processor<I,​O> actual)
        Constructor that wraps an actual processor.
        Parameters:
        actual - the subject wrapped
    • Method Detail

      • subscribe

        public void subscribe​(org.reactivestreams.Subscriber<? super O> downstream)
        Specified by:
        subscribe in interface org.reactivestreams.Publisher<I>
      • onSubscribe

        public void onSubscribe​(org.reactivestreams.Subscription s)
        Specified by:
        onSubscribe in interface org.reactivestreams.Subscriber<I>
      • onNext

        public void onNext​(I item)
        Specified by:
        onNext in interface org.reactivestreams.Subscriber<I>
      • onError

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

        public void onComplete()
        Specified by:
        onComplete in interface org.reactivestreams.Subscriber<I>
      • dispatch

        public void dispatch​(java.util.List<java.lang.Object> queue,
                             org.reactivestreams.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