Module methanol

Class AbstractQueueSubscription<T>

All Implemented Interfaces:
Flow.Subscription
Direct Known Subclasses:
SubmittableSubscription

public class AbstractQueueSubscription<T> extends AbstractPollableSubscription<T>
A subscription that emits items from a queue and completes downstream as soon as a sentinel value is observed.
  • Constructor Details

  • Method Details

    • submit

      protected void submit(T item)
    • submitSilently

      protected void submitSilently(T item)
    • submitAndComplete

      protected void submitAndComplete(T lastItem)
    • poll

      protected @Nullable T poll()
      Description copied from class: AbstractPollableSubscription
      Returns the next item, or null if no items are available.
      Specified by:
      poll in class AbstractPollableSubscription<T>
    • isComplete

      protected boolean isComplete()
      Description copied from class: AbstractPollableSubscription
      Returns true if downstream is to be completed. Implementation must ensure true isn't returned unless the subscription knows it won't produce any more items AND there aren't any present items expected to be polled.
      Specified by:
      isComplete in class AbstractPollableSubscription<T>
    • abort

      protected void abort(boolean flowInterrupted)
      Description copied from class: AbstractSubscription
      Releases resources held by this subscription. flowInterrupted tells whether cancellation was due to flow interruption by downstream (e.g. calling cancel() or throwing from onNext or onSubscribe), or due to ending the normal flow of signals (onSubscribe -> onNext* -> (onError | onComplete)).
      Overrides:
      abort in class AbstractSubscription<T>
    • complete

      protected void complete()