Package akka.stream.javadsl
Interface SourceQueue<T>
-
- All Known Subinterfaces:
SourceQueueWithComplete<T>
public interface SourceQueue<T>This trait allows to have a queue as a data source for some stream.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.util.concurrent.CompletionStage<QueueOfferResult>offer(T elem)Offers an element to a stream and returns aCompletionStagethat: - completes withEnqueuedif the element is consumed by a stream - completes withDroppedwhen the stream dropped the offered element - completes withQueueClosedwhen the stream is completed whilst theCompletionStageis active - completes withFailure(f)in case of failure to enqueue element from upstream - fails when stream is already completedjava.util.concurrent.CompletionStage<Done>watchCompletion()Returns aCompletionStagethat will be completed if this operator completes, or will be failed when the stream is failed.
-
-
-
Method Detail
-
offer
java.util.concurrent.CompletionStage<QueueOfferResult> offer(T elem)
Offers an element to a stream and returns aCompletionStagethat: - completes withEnqueuedif the element is consumed by a stream - completes withDroppedwhen the stream dropped the offered element - completes withQueueClosedwhen the stream is completed whilst theCompletionStageis active - completes withFailure(f)in case of failure to enqueue element from upstream - fails when stream is already completedAdditionally when using the backpressure overflowStrategy: - If the buffer is full the
CompletionStagewon't be completed until there is space in the buffer - Calling offer before theCompletionStageis completed, in this case it will return a failedCompletionStage- Parameters:
elem- element to send to a stream
-
watchCompletion
java.util.concurrent.CompletionStage<Done> watchCompletion()
Returns aCompletionStagethat will be completed if this operator completes, or will be failed when the stream is failed.
-
-