Class SourceQueueAdapter<T>

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void complete()
      Complete the stream normally.
      void fail​(java.lang.Throwable ex)
      Complete the stream with a failure.
      java.util.concurrent.CompletionStage<QueueOfferResult> offer​(T elem)
      Method offers next element to a stream and returns future that: - completes with Enqueued if element is consumed by a stream - completes with Dropped when stream dropped offered element - completes with QueueClosed when stream is completed during future is active - completes with Failure(f) when failure to enqueue element from upstream - fails when stream is completed
      java.util.concurrent.CompletionStage<Done> watchCompletion()
      Method returns a CompletionStage that will be completed if this operator completes, or will be failed when the stream fails, for example when SourceQueueWithComplete.fail is invoked.
      • Methods inherited from class java.lang.Object

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

      • complete

        public void complete()
        Description copied from interface: SourceQueueWithComplete
        Complete the stream normally. Use watchCompletion to be notified of this operation&rsquo;s success.

        Note that this only means the elements have been passed downstream, not that downstream has successfully processed them.

        Specified by:
        complete in interface SourceQueueWithComplete<T>
      • fail

        public void fail​(java.lang.Throwable ex)
        Description copied from interface: SourceQueueWithComplete
        Complete the stream with a failure. Use watchCompletion to be notified of this operation&rsquo;s success.

        Note that this only means the elements have been passed downstream, not that downstream has successfully processed them.

        Specified by:
        fail in interface SourceQueueWithComplete<T>
        Parameters:
        ex - (undocumented)
      • offer

        public java.util.concurrent.CompletionStage<QueueOfferResult> offer​(T elem)
        Description copied from interface: SourceQueue
        Method offers next element to a stream and returns future that: - completes with Enqueued if element is consumed by a stream - completes with Dropped when stream dropped offered element - completes with QueueClosed when stream is completed during future is active - completes with Failure(f) when failure to enqueue element from upstream - fails when stream is completed

        Additionally when using the backpressure overflowStrategy: - If the buffer is full the Future won't be completed until there is space in the buffer - Calling offer before the Future is completed in this case will return a failed Future

        Specified by:
        offer in interface SourceQueue<T>
        Parameters:
        elem - element to send to a stream
        Returns:
        (undocumented)
      • watchCompletion

        public java.util.concurrent.CompletionStage<Done> watchCompletion()
        Description copied from interface: SourceQueueWithComplete
        Method returns a CompletionStage that will be completed if this operator completes, or will be failed when the stream fails, for example when SourceQueueWithComplete.fail is invoked.
        Specified by:
        watchCompletion in interface SourceQueue<T>
        Specified by:
        watchCompletion in interface SourceQueueWithComplete<T>
        Returns:
        (undocumented)