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 Object
implements Flow.Subscriber<T>
Subscriber for method consume
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) final CompletableFuture<Void> (package private) Flow.Subscription -
Constructor Summary
ConstructorsConstructorDescriptionConsumerSubscriber(CompletableFuture<Void> status, Consumer<? super T> consumer) -
Method Summary
Modifier and TypeMethodDescriptionfinal voidMethod 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.final voidMethod invoked upon an unrecoverable error encountered by a Publisher or Subscription, after which no other Subscriber methods are invoked by the Subscription.final voidMethod invoked with a Subscription's next item.final voidonSubscribe(Flow.Subscription subscription) Method invoked prior to invoking any other Subscriber methods for the given Subscription.
-
Field Details
-
status
-
consumer
-
subscription
Flow.Subscription subscription
-
-
Constructor Details
-
ConsumerSubscriber
ConsumerSubscriber(CompletableFuture<Void> status, Consumer<? super T> consumer)
-
-
Method Details
-
onSubscribe
Description copied from interface:Flow.SubscriberMethod 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.requestto enable receiving items.- Specified by:
onSubscribein interfaceFlow.Subscriber<T>- Parameters:
subscription- a new subscription
-
onError
Description copied from interface:Flow.SubscriberMethod 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:
onErrorin interfaceFlow.Subscriber<T>- Parameters:
ex- the exception
-
onComplete
public final void onComplete()Description copied from interface:Flow.SubscriberMethod 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:
onCompletein interfaceFlow.Subscriber<T>
-
onNext
Description copied from interface:Flow.SubscriberMethod 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:
onNextin interfaceFlow.Subscriber<T>- Parameters:
item- the item
-