Package akka.stream.javadsl
Interface SourceQueue<T>
-
- All Known Subinterfaces:
SourceQueueWithComplete<T>
- All Known Implementing Classes:
SourceQueueAdapter
public interface SourceQueue<T>
Method offers next element to a stream and returns future that: - completes withEnqueued
if element is consumed by a stream - completes withDropped
when stream dropped offered element - completes withQueueClosed
when stream is completed during future is active - completes withFailure(f)
when failure to enqueue element from upstream - fails when stream is completedAdditionally 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
param: elem element to send to a stream
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.util.concurrent.CompletionStage<QueueOfferResult>
offer(T elem)
Method offers next element to a stream and returns future that: - completes withEnqueued
if element is consumed by a stream - completes withDropped
when stream dropped offered element - completes withQueueClosed
when stream is completed during future is active - completes withFailure(f)
when failure to enqueue element from upstream - fails when stream is completedjava.util.concurrent.CompletionStage<Done>
watchCompletion()
Method returns aCompletionStage
that 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)
Method offers next element to a stream and returns future that: - completes withEnqueued
if element is consumed by a stream - completes withDropped
when stream dropped offered element - completes withQueueClosed
when stream is completed during future is active - completes withFailure(f)
when failure to enqueue element from upstream - fails when stream is completedAdditionally 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
- Parameters:
elem
- element to send to a stream- Returns:
- (undocumented)
-
watchCompletion
java.util.concurrent.CompletionStage<Done> watchCompletion()
Method returns aCompletionStage
that will be completed if this operator completes, or will be failed when the stream is failed.- Returns:
- (undocumented)
-
-