Package io.servicetalk.concurrent.api
Class DemandCheckingSubscriber<T>
- java.lang.Object
-
- io.servicetalk.concurrent.api.DemandCheckingSubscriber<T>
-
- Type Parameters:
T- Type of items received by theSubscriber.
- All Implemented Interfaces:
PublisherSource.Subscriber<T>
public final class DemandCheckingSubscriber<T> extends java.lang.Object implements PublisherSource.Subscriber<T>
APublisherSource.Subscriberthat wraps another, and asserts that items are not delivered without sufficient demand.
-
-
Constructor Summary
Constructors Constructor Description DemandCheckingSubscriber(PublisherSource.Subscriber<? super T> delegate)Create a newDemandCheckingSubscriberthat delegates todelegate.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidonComplete()Callback to signal completion of thePublisherSourcefor thisSubscriber.voidonError(java.lang.Throwable t)Callback to receive anerrorfor thisSubscriber.voidonNext(T t)Callback to receive adataelement for thisSubscriber.voidonSubscribe(PublisherSource.Subscription s)Callback to receive aPublisherSource.Subscriptionfor thisSubscriber.
-
-
-
Constructor Detail
-
DemandCheckingSubscriber
public DemandCheckingSubscriber(PublisherSource.Subscriber<? super T> delegate)
Create a newDemandCheckingSubscriberthat delegates todelegate.- Parameters:
delegate- thePublisherSource.Subscriberto delegate to.
-
-
Method Detail
-
onSubscribe
public void onSubscribe(PublisherSource.Subscription s)
Description copied from interface:PublisherSource.SubscriberCallback to receive aPublisherSource.Subscriptionfor thisSubscriber.See Reactive Streams specifications for the rules about how and when this method will be invoked.
- Specified by:
onSubscribein interfacePublisherSource.Subscriber<T>- Parameters:
s-PublisherSource.Subscriptionfor thisSubscriber.
-
onNext
public void onNext(T t)
Description copied from interface:PublisherSource.SubscriberCallback to receive adataelement for thisSubscriber.See Reactive Streams specifications for the rules about how and when this method will be invoked.
- Specified by:
onNextin interfacePublisherSource.Subscriber<T>- Parameters:
t- Adataelement.
-
onError
public void onError(java.lang.Throwable t)
Description copied from interface:PublisherSource.SubscriberCallback to receive anerrorfor thisSubscriber.See Reactive Streams specifications for the rules about how and when this method will be invoked.
- Specified by:
onErrorin interfacePublisherSource.Subscriber<T>- Parameters:
t-errorfor thisSubscriber.
-
onComplete
public void onComplete()
Description copied from interface:PublisherSource.SubscriberCallback to signal completion of thePublisherSourcefor thisSubscriber.See Reactive Streams specifications for the rules about how and when this method will be invoked.
- Specified by:
onCompletein interfacePublisherSource.Subscriber<T>
-
-