Package akka.stream.impl
Class SourceQueueAdapter<T>
- java.lang.Object
-
- akka.stream.impl.SourceQueueAdapter<T>
-
- All Implemented Interfaces:
SourceQueue<T>
,SourceQueueWithComplete<T>
public final class SourceQueueAdapter<T> extends java.lang.Object implements SourceQueueWithComplete<T>
INTERNAL API
-
-
Constructor Summary
Constructors Constructor Description SourceQueueAdapter(SourceQueueWithComplete<T> delegate)
-
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 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 fails, for example whenSourceQueueWithComplete.fail
is invoked.
-
-
-
Constructor Detail
-
SourceQueueAdapter
public SourceQueueAdapter(SourceQueueWithComplete<T> delegate)
-
-
Method Detail
-
complete
public void complete()
Description copied from interface:SourceQueueWithComplete
Complete the stream normally. UsewatchCompletion
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.
- Specified by:
complete
in interfaceSourceQueueWithComplete<T>
-
fail
public void fail(java.lang.Throwable ex)
Description copied from interface:SourceQueueWithComplete
Complete the stream with a failure. UsewatchCompletion
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.
- Specified by:
fail
in interfaceSourceQueueWithComplete<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 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
- Specified by:
offer
in interfaceSourceQueue<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 aCompletionStage
that will be completed if this operator completes, or will be failed when the stream fails, for example whenSourceQueueWithComplete.fail
is invoked.- Specified by:
watchCompletion
in interfaceSourceQueue<T>
- Specified by:
watchCompletion
in interfaceSourceQueueWithComplete<T>
- Returns:
- (undocumented)
-
-