use of com.oath.cyclops.internal.react.async.future.CompletedException in project cyclops by aol.
the class LazyToQueue method addToQueue.
@Override
default void addToQueue(final Queue queue) {
FutureStream str = thenSync(queue::add).self(s -> {
if (this.getPopulator().isPoolingActive())
s.peekSync(v -> {
throw new CompletedException(v);
});
});
final Continuation continuation = queue.getContinuationStrategy().isBlocking() ? str.blockingContinuation(() -> {
throw new ClosedQueueException();
}) : str.runContinuation(() -> {
throw new ClosedQueueException();
});
queue.addContinuation(continuation);
}
Aggregations