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 voidcomplete()Complete the stream normally.voidfail(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 withEnqueuedif element is consumed by a stream - completes withDroppedwhen stream dropped offered element - completes withQueueClosedwhen 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 aCompletionStagethat will be completed if this operator completes, or will be failed when the stream fails, for example whenSourceQueueWithComplete.failis invoked.
-
-
-
Constructor Detail
-
SourceQueueAdapter
public SourceQueueAdapter(SourceQueueWithComplete<T> delegate)
-
-
Method Detail
-
complete
public void complete()
Description copied from interface:SourceQueueWithCompleteComplete the stream normally. UsewatchCompletionto 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:
completein interfaceSourceQueueWithComplete<T>
-
fail
public void fail(java.lang.Throwable ex)
Description copied from interface:SourceQueueWithCompleteComplete the stream with a failure. UsewatchCompletionto 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:
failin interfaceSourceQueueWithComplete<T>- Parameters:
ex- (undocumented)
-
offer
public java.util.concurrent.CompletionStage<QueueOfferResult> offer(T elem)
Description copied from interface:SourceQueueMethod offers next element to a stream and returns future that: - completes withEnqueuedif element is consumed by a stream - completes withDroppedwhen stream dropped offered element - completes withQueueClosedwhen 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:
offerin interfaceSourceQueue<T>- Parameters:
elem- element to send to a stream- Returns:
- (undocumented)
-
watchCompletion
public java.util.concurrent.CompletionStage<Done> watchCompletion()
Description copied from interface:SourceQueueWithCompleteMethod returns aCompletionStagethat will be completed if this operator completes, or will be failed when the stream fails, for example whenSourceQueueWithComplete.failis invoked.- Specified by:
watchCompletionin interfaceSourceQueue<T>- Specified by:
watchCompletionin interfaceSourceQueueWithComplete<T>- Returns:
- (undocumented)
-
-