Class StoringSubscriber<T>
- java.lang.Object
-
- software.amazon.awssdk.utils.async.StoringSubscriber<T>
-
- All Implemented Interfaces:
org.reactivestreams.Subscriber<T>
public class StoringSubscriber<T> extends Object implements org.reactivestreams.Subscriber<T>
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
StoringSubscriber.Event<T>
An event stored for later retrieval by this subscriber.static class
StoringSubscriber.EventType
-
Constructor Summary
Constructors Constructor Description StoringSubscriber(int maxEvents)
Create a subscriber that stores up tomaxElements
events for retrieval.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method 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.
-
-
-
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:
onSubscribe
in interfaceorg.reactivestreams.Subscriber<T>
-
onComplete
public void onComplete()
- Specified by:
onComplete
in interfaceorg.reactivestreams.Subscriber<T>
-
-