Class StoringSubscriber<T>
- java.lang.Object
-
- software.amazon.awssdk.utils.async.StoringSubscriber<T>
-
- All Implemented Interfaces:
org.reactivestreams.Subscriber<T>
@SdkProtectedApi public class StoringSubscriber<T> extends Object implements org.reactivestreams.Subscriber<T>
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classStoringSubscriber.Event<T>An event stored for later retrieval by this subscriber.static classStoringSubscriber.EventType
-
Constructor Summary
Constructors Constructor Description StoringSubscriber(int maxEvents)Create a subscriber that stores up tomaxElementsevents for retrieval.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidonComplete()voidonError(Throwable throwable)voidonNext(T t)voidonSubscribe(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.
-
-
-
Method Detail
-
peek
public Optional<StoringSubscriber.Event<T>> peek()
Check the first event stored in this subscriber.This will return empty if no events are currently available (outstanding demand has not yet been filled).
-
poll
public Optional<StoringSubscriber.Event<T>> poll()
Remove and return the first event stored in this subscriber.This will return empty if no events are currently available (outstanding demand has not yet been filled).
-
onSubscribe
public void onSubscribe(org.reactivestreams.Subscription subscription)
- Specified by:
onSubscribein interfaceorg.reactivestreams.Subscriber<T>
-
onComplete
public void onComplete()
- Specified by:
onCompletein interfaceorg.reactivestreams.Subscriber<T>
-
-