Interface BoundedSourceQueue<T>


public interface BoundedSourceQueue<T>
A queue of the given size that gives immediate feedback whether an element could be enqueued or not.

Not for user extension

  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Completes the stream normally.
    void
    Completes the stream with a failure.
    boolean
    Returns true if the stream has been completed, either normally or with failure.
    offer(T elem)
    Returns a pekko.stream.QueueOfferResult that notifies the caller if the element could be enqueued or not, or the completion status of the queue.
    int
    Returns the approximate number of elements in this queue.
  • Method Details

    • complete

      void complete()
      Completes the stream normally.
    • fail

      void fail(Throwable ex)
      Completes the stream with a failure.
    • isCompleted

      boolean isCompleted()
      Returns true if the stream has been completed, either normally or with failure.

      Since:
      1.1.0
    • offer

      QueueOfferResult offer(T elem)
      Returns a pekko.stream.QueueOfferResult that notifies the caller if the element could be enqueued or not, or the completion status of the queue.

      A result of QueueOfferResult.Enqueued does not guarantee that an element also has been or will be processed by the downstream.

    • size

      int size()
      Returns the approximate number of elements in this queue.