SourceQueueWithComplete

org.apache.pekko.stream.javadsl.SourceQueueWithComplete
See theSourceQueueWithComplete companion object
trait SourceQueueWithComplete[T] extends SourceQueue[T]

This trait adds completion support to SourceQueue.

Attributes

Companion
object
Source
Queue.scala
Graph
Supertypes
trait SourceQueue[T]
class Object
trait Matchable
class Any

Members list

Value members

Abstract methods

def complete(): Unit

Completes the stream normally. Use watchCompletion to be notified of this operation’s success.

Completes the stream normally. Use watchCompletion to be notified of this operation’s success.

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

Attributes

Source
Queue.scala
def fail(ex: Throwable): Unit

Completes the stream with a failure. Use watchCompletion to be notified of this operation’s success.

Completes the stream with a failure. Use watchCompletion to be notified of this operation’s success.

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

Attributes

Source
Queue.scala
override def watchCompletion(): CompletionStage[Done]

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.

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.

Attributes

Definition Classes
Source
Queue.scala

Inherited methods

def offer(elem: T): CompletionStage[QueueOfferResult]

Offers an element to a stream and returns a CompletionStage that:

Offers an element to a stream and returns a CompletionStage that:

  • completes with Enqueued if the element is consumed by a stream
  • completes with Dropped when the stream dropped the offered element
  • completes with QueueClosed when the stream is completed whilst the CompletionStage is active
  • completes with Failure(f) in case of failure to enqueue element from upstream
  • fails when stream is already completed

Additionally when using the backpressure overflowStrategy:

  • If the buffer is full the CompletionStage won't be completed until there is space in the buffer
  • Calling offer before the CompletionStage is completed, in this case it will return a failed CompletionStage

Value parameters

elem

element to send to a stream

Attributes

Inherited from:
SourceQueue
Source
Queue.scala