private static final class SubmissionPublisher.ConsumerSubscriber<T> extends java.lang.Object implements Flow.Subscriber<T>
Modifier and Type | Field and Description |
---|---|
(package private) java.util.function.Consumer<? super T> |
consumer |
(package private) java.util.concurrent.CompletableFuture<java.lang.Void> |
status |
(package private) Flow.Subscription |
subscription |
Constructor and Description |
---|
ConsumerSubscriber(java.util.concurrent.CompletableFuture<java.lang.Void> status,
java.util.function.Consumer<? super T> consumer) |
Modifier and Type | Method and Description |
---|---|
void |
onComplete()
Method invoked when it is known that no additional
Subscriber method invocations will occur for a Subscription
that is not already terminated by error, after which no
other Subscriber methods are invoked by the Subscription.
|
void |
onError(java.lang.Throwable ex)
Method invoked upon an unrecoverable error encountered by a
Publisher or Subscription, after which no other Subscriber
methods are invoked by the Subscription.
|
void |
onNext(T item)
Method invoked with a Subscription's next item.
|
void |
onSubscribe(Flow.Subscription subscription)
Method invoked prior to invoking any other Subscriber
methods for the given Subscription.
|
final java.util.concurrent.CompletableFuture<java.lang.Void> status
final java.util.function.Consumer<? super T> consumer
Flow.Subscription subscription
ConsumerSubscriber(java.util.concurrent.CompletableFuture<java.lang.Void> status, java.util.function.Consumer<? super T> consumer)
public final void onSubscribe(Flow.Subscription subscription)
Flow.Subscriber
Typically, implementations of this method invoke subscription.request
to enable receiving items.
onSubscribe
in interface Flow.Subscriber<T>
subscription
- a new subscriptionpublic final void onError(java.lang.Throwable ex)
Flow.Subscriber
onError
in interface Flow.Subscriber<T>
ex
- the exceptionpublic final void onComplete()
Flow.Subscriber
onComplete
in interface Flow.Subscriber<T>
public final void onNext(T item)
Flow.Subscriber
onNext
in interface Flow.Subscriber<T>
item
- the item