- java.lang.Object
-
- io.helidon.common.reactive.BufferedProcessor<T,T>
-
- io.helidon.common.reactive.MultiSkipProcessor<T>
-
- Type Parameters:
T- item type
- All Implemented Interfaces:
Multi<T>,Subscribable<T>,Flow.Processor<T,T>,Flow.Publisher<T>,Flow.Subscriber<T>,Flow.Subscription
public class MultiSkipProcessor<T> extends BufferedProcessor<T,T> implements Multi<T>
Skip first n items, all the others are emitted.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcancel()static <T> MultiSkipProcessor<T>create(Long skip)Create newMultiSkipProcessor.protected voiddoSubscribe(Flow.Publisher<U> delegate)Subscribe the subscriber after the given delegate publisher.protected voidfail(Throwable ex)OnError downstream.protected voidfailAndCancel(Throwable ex)OnError downstream and cancel upstream.protected RequestedCountergetRequestedCounter()ReturnsRequestedCounterwith information about requested vs.protected SingleSubscriberHolder<U>getSubscriber()Processor'sSingleSubscriberHolder.protected Optional<Flow.Subscription>getSubscription()Processor'sFlow.Subscriptionregistered byFlow.Subscriber.onSubscribe(Flow.Subscription).protected voidhookOnCancel(Flow.Subscription subscription)Hook forSingleSubscriberHolder.cancel().protected voidhookOnComplete()Hook forFlow.Subscriber.onComplete().protected voidhookOnError(Throwable error)protected voidhookOnNext(T item)Hook forFlow.Subscriber.onNext(java.lang.Object).voidonError(Throwable ex)voidonNext(T item)voidonSubscribe(Flow.Subscription s)voidrequest(long n)protected voidsubmit(U item)Submit an item to the subscriber.voidsubscribe(Flow.Subscriber<? super U> s)protected voidtryComplete()Try close processor's subscriber.-
Methods inherited from class io.helidon.common.reactive.BufferedProcessor
notEnoughRequest, onComplete, tryRequest
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.util.concurrent.Flow.Publisher
subscribe
-
Methods inherited from interface io.helidon.common.reactive.Multi
collect, collectList, distinct, dropWhile, filter, first, flatMap, flatMapIterable, forEach, limit, map, peek, skip, takeWhile
-
Methods inherited from interface io.helidon.common.reactive.Subscribable
onComplete, onError, onErrorResume, onErrorResumeWith, onTerminate, subscribe, subscribe, subscribe, subscribe
-
-
-
-
Method Detail
-
create
public static <T> MultiSkipProcessor<T> create(Long skip)
Create newMultiSkipProcessor.- Type Parameters:
T- item type- Parameters:
skip- number of items to be skipped- Returns:
MultiSkipProcessor
-
hookOnNext
protected void hookOnNext(T item)
Hook forFlow.Subscriber.onNext(java.lang.Object).- Parameters:
item- next item
-
request
public void request(long n)
- Specified by:
requestin interfaceFlow.Subscription
-
cancel
public void cancel()
- Specified by:
cancelin interfaceFlow.Subscription
-
onSubscribe
public void onSubscribe(Flow.Subscription s)
- Specified by:
onSubscribein interfaceFlow.Subscriber<T>
-
onNext
public void onNext(T item)
- Specified by:
onNextin interfaceFlow.Subscriber<T>
-
fail
protected void fail(Throwable ex)
OnError downstream.- Parameters:
ex- Exception to be reported downstream
-
failAndCancel
protected void failAndCancel(Throwable ex)
OnError downstream and cancel upstream.- Parameters:
ex- Exception to be reported downstream
-
onError
public void onError(Throwable ex)
- Specified by:
onErrorin interfaceFlow.Subscriber<T>
-
subscribe
public void subscribe(Flow.Subscriber<? super U> s)
- Specified by:
subscribein interfaceFlow.Publisher<T>
-
getSubscription
protected Optional<Flow.Subscription> getSubscription()
Processor'sFlow.Subscriptionregistered byFlow.Subscriber.onSubscribe(Flow.Subscription).- Returns:
Flow.Subscription
-
getSubscriber
protected SingleSubscriberHolder<U> getSubscriber()
Processor'sSingleSubscriberHolder.- Returns:
SingleSubscriberHolder
-
getRequestedCounter
protected RequestedCounter getRequestedCounter()
ReturnsRequestedCounterwith information about requested vs. submitted items.- Returns:
RequestedCounter
-
submit
protected void submit(U item)
Submit an item to the subscriber.- Parameters:
item- item to be submitted
-
hookOnError
protected void hookOnError(Throwable error)
- Parameters:
error- error received
-
hookOnComplete
protected void hookOnComplete()
Hook forFlow.Subscriber.onComplete().
-
hookOnCancel
protected void hookOnCancel(Flow.Subscription subscription)
Hook forSingleSubscriberHolder.cancel().- Parameters:
subscription- of the processor for optional passing cancel event
-
doSubscribe
protected final void doSubscribe(Flow.Publisher<U> delegate)
Subscribe the subscriber after the given delegate publisher.- Parameters:
delegate- delegate publisher
-
tryComplete
protected void tryComplete()
Try close processor's subscriber.
-
-