public final class SourceQueueAdapter<T> extends java.lang.Object implements SourceQueueWithComplete<T>
Constructor and Description |
---|
SourceQueueAdapter(SourceQueueWithComplete<T> delegate) |
Modifier and Type | Method and 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 with
Enqueued if element is consumed by a stream
- completes with Dropped when stream dropped offered element
- completes with QueueClosed when stream is completed during future is active
- completes with Failure(f) when failure to enqueue element from upstream
- fails when stream is completed or you cannot call offer in this moment because of implementation rules
(like for backpressure mode and full buffer you need to wait for last offer call Future completion) |
java.util.concurrent.CompletionStage<Done> |
watchCompletion()
Method returns future that completes when stream is completed and fails when stream failed
|
public SourceQueueAdapter(SourceQueueWithComplete<T> delegate)
public java.util.concurrent.CompletionStage<QueueOfferResult> offer(T elem)
SourceQueue
Enqueued
if element is consumed by a stream
- completes with Dropped
when stream dropped offered element
- completes with QueueClosed
when stream is completed during future is active
- completes with Failure(f)
when failure to enqueue element from upstream
- fails when stream is completed or you cannot call offer in this moment because of implementation rules
(like for backpressure mode and full buffer you need to wait for last offer call Future completion)
offer
in interface SourceQueue<T>
elem
- element to send to a streampublic java.util.concurrent.CompletionStage<Done> watchCompletion()
SourceQueue
watchCompletion
in interface SourceQueue<T>
public void complete()
SourceQueueWithComplete
watchCompletion
to be notified of this
operation’s success.complete
in interface SourceQueueWithComplete<T>
public void fail(java.lang.Throwable ex)
SourceQueueWithComplete
watchCompletion
to be notified of this
operation’s success.fail
in interface SourceQueueWithComplete<T>
ex
- (undocumented)