Class SubmissionPublisher.ConsumerSubscriber<T>
- java.lang.Object
-
- org.glassfish.jersey.internal.jsr166.SubmissionPublisher.ConsumerSubscriber<T>
-
- All Implemented Interfaces:
Flow.Subscriber<T>
- Enclosing class:
- SubmissionPublisher<T>
private static final class SubmissionPublisher.ConsumerSubscriber<T> extends java.lang.Object implements Flow.Subscriber<T>
Subscriber for method consume
-
-
Field Summary
Fields Modifier and Type Field 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 Summary
Constructors Constructor Description ConsumerSubscriber(java.util.concurrent.CompletableFuture<java.lang.Void> status, java.util.function.Consumer<? super T> consumer)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method 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.
-
-
-
Field Detail
-
status
final java.util.concurrent.CompletableFuture<java.lang.Void> status
-
consumer
final java.util.function.Consumer<? super T> consumer
-
subscription
Flow.Subscription subscription
-
-
Constructor Detail
-
ConsumerSubscriber
ConsumerSubscriber(java.util.concurrent.CompletableFuture<java.lang.Void> status, java.util.function.Consumer<? super T> consumer)
-
-
Method Detail
-
onSubscribe
public final void onSubscribe(Flow.Subscription subscription)
Description copied from interface:Flow.Subscriber
Method invoked prior to invoking any other Subscriber methods for the given Subscription. If this method throws an exception, resulting behavior is not guaranteed, but may cause the Subscription not to be established or to be cancelled.Typically, implementations of this method invoke
subscription.request
to enable receiving items.- Specified by:
onSubscribe
in interfaceFlow.Subscriber<T>
- Parameters:
subscription
- a new subscription
-
onError
public final void onError(java.lang.Throwable ex)
Description copied from interface:Flow.Subscriber
Method invoked upon an unrecoverable error encountered by a Publisher or Subscription, after which no other Subscriber methods are invoked by the Subscription. If this method itself throws an exception, resulting behavior is undefined.- Specified by:
onError
in interfaceFlow.Subscriber<T>
- Parameters:
ex
- the exception
-
onComplete
public final void onComplete()
Description copied from interface:Flow.Subscriber
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. If this method throws an exception, resulting behavior is undefined.- Specified by:
onComplete
in interfaceFlow.Subscriber<T>
-
onNext
public final void onNext(T item)
Description copied from interface:Flow.Subscriber
Method invoked with a Subscription's next item. If this method throws an exception, resulting behavior is not guaranteed, but may cause the Subscription to be cancelled.- Specified by:
onNext
in interfaceFlow.Subscriber<T>
- Parameters:
item
- the item
-
-