Class CompletionAwareSubscriber<T>

java.lang.Object
io.micronaut.core.async.subscriber.CompletionAwareSubscriber<T>
Type Parameters:
T - the type of element signaled.
All Implemented Interfaces:
Completable, Emitter<T>, org.reactivestreams.Subscriber<T>
Direct Known Subclasses:
SingleSubscriberProcessor, TypedSubscriber

public abstract class CompletionAwareSubscriber<T> extends Object implements org.reactivestreams.Subscriber<T>, Emitter<T>
A Subscriber that tracks completion state using a AtomicBoolean.
Since:
1.0
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected org.reactivestreams.Subscription
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected abstract void
    Implement Subscriber.onComplete().
    protected abstract void
    Implement Subscriber.onError(Throwable).
    protected abstract void
    doOnNext(T message)
    Implement Subscriber.onNext(Object).
    protected abstract void
    doOnSubscribe(org.reactivestreams.Subscription subscription)
    Implement Subscriber.onSubscribe(Subscription).
    boolean
     
    final void
    * Successful terminal state.
    final void
    Failed terminal state.
    final void
    onNext(T t)
    Data notification sent by the Publisher in response to requests to Subscription.request(long).
    final void
    onSubscribe(org.reactivestreams.Subscription s)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • subscription

      protected org.reactivestreams.Subscription subscription
  • Constructor Details

    • CompletionAwareSubscriber

      public CompletionAwareSubscriber()
  • Method Details

    • onSubscribe

      public final void onSubscribe(org.reactivestreams.Subscription s)
      Specified by:
      onSubscribe in interface org.reactivestreams.Subscriber<T>
    • isComplete

      public boolean isComplete()
      Returns:
      Whether is complete
    • onNext

      public final void onNext(T t)
      Description copied from interface: Emitter
      Data notification sent by the Publisher in response to requests to Subscription.request(long).
      Specified by:
      onNext in interface Emitter<T>
      Specified by:
      onNext in interface org.reactivestreams.Subscriber<T>
      Parameters:
      t - the element signaled
    • onError

      public final void onError(Throwable t)
      Description copied from interface: Emitter
      Failed terminal state.

      No further events will be sent even if Subscription.request(long) is invoked again.

      Specified by:
      onError in interface Emitter<T>
      Specified by:
      onError in interface org.reactivestreams.Subscriber<T>
      Parameters:
      t - the throwable signaled
    • onComplete

      public final void onComplete()
      Description copied from interface: Completable
      * Successful terminal state. To be called when the operation is complete.
      Specified by:
      onComplete in interface Completable
      Specified by:
      onComplete in interface org.reactivestreams.Subscriber<T>
      See Also:
      • Subscriber.onComplete()
    • doOnSubscribe

      protected abstract void doOnSubscribe(org.reactivestreams.Subscription subscription)
      Implement Subscriber.onSubscribe(Subscription).
      Parameters:
      subscription - The subscription
    • doOnNext

      protected abstract void doOnNext(T message)
      Implement Subscriber.onNext(Object).
      Parameters:
      message - The message
    • doOnError

      protected abstract void doOnError(Throwable t)
      Implement Subscriber.onError(Throwable).
      Parameters:
      t - The throwable
    • doOnComplete

      protected abstract void doOnComplete()
      Implement Subscriber.onComplete().