public class StoringSubscriber<T> extends Object implements org.reactivestreams.Subscriber<T>
| Modifier and Type | Class and Description | 
|---|---|
| static class  | StoringSubscriber.Event<T>An event stored for later retrieval by this subscriber. | 
| static class  | StoringSubscriber.EventType | 
| Constructor and Description | 
|---|
| StoringSubscriber(int maxEvents)Create a subscriber that stores up to  maxElementsevents for retrieval. | 
| Modifier and Type | Method and Description | 
|---|---|
| void | onComplete() | 
| void | onError(Throwable throwable) | 
| void | onNext(T t) | 
| void | onSubscribe(org.reactivestreams.Subscription subscription) | 
| Optional<StoringSubscriber.Event<T>> | peek()Check the first event stored in this subscriber. | 
| Optional<StoringSubscriber.Event<T>> | poll()Remove and return the first event stored in this subscriber. | 
public StoringSubscriber(int maxEvents)
maxElements events for retrieval.public Optional<StoringSubscriber.Event<T>> peek()
This will return empty if no events are currently available (outstanding demand has not yet been filled).
public Optional<StoringSubscriber.Event<T>> poll()
This will return empty if no events are currently available (outstanding demand has not yet been filled).
public void onSubscribe(org.reactivestreams.Subscription subscription)
onSubscribe in interface org.reactivestreams.Subscriber<T>public void onComplete()
onComplete in interface org.reactivestreams.Subscriber<T>Copyright © 2023. All rights reserved.