public final class LambdaSubscriber<T> extends AtomicReference<org.reactivestreams.Subscription> implements FlowableSubscriber<T>, org.reactivestreams.Subscription, Disposable, LambdaConsumerIntrospection
Constructor and Description |
---|
LambdaSubscriber(Consumer<? super T> onNext,
Consumer<? super Throwable> onError,
Action onComplete,
Consumer<? super org.reactivestreams.Subscription> onSubscribe) |
Modifier and Type | Method and Description |
---|---|
void |
cancel() |
void |
dispose()
Dispose the resource, the operation should be idempotent.
|
boolean |
hasCustomOnError()
Returns true or false if a custom onError consumer has been provided.
|
boolean |
isDisposed()
Returns true if this resource has been disposed.
|
void |
onComplete() |
void |
onError(Throwable t) |
void |
onNext(T t) |
void |
onSubscribe(org.reactivestreams.Subscription s)
Implementors of this method should make sure everything that needs
to be visible in
Subscriber.onNext(Object) is established before
calling Subscription.request(long) . |
void |
request(long n) |
accumulateAndGet, compareAndSet, get, getAndAccumulate, getAndSet, getAndUpdate, lazySet, set, toString, updateAndGet, weakCompareAndSet
public void onSubscribe(org.reactivestreams.Subscription s)
FlowableSubscriber
Subscriber.onNext(Object)
is established before
calling Subscription.request(long)
. In practice this means
no initialization should happen after the request()
call and
additional behavior is thread safe in respect to onNext
.
onSubscribe
in interface FlowableSubscriber<T>
onSubscribe
in interface org.reactivestreams.Subscriber<T>
public void onError(Throwable t)
onError
in interface org.reactivestreams.Subscriber<T>
public void onComplete()
onComplete
in interface org.reactivestreams.Subscriber<T>
public void dispose()
Disposable
dispose
in interface Disposable
public boolean isDisposed()
Disposable
isDisposed
in interface Disposable
public void request(long n)
request
in interface org.reactivestreams.Subscription
public void cancel()
cancel
in interface org.reactivestreams.Subscription
public boolean hasCustomOnError()
LambdaConsumerIntrospection
hasCustomOnError
in interface LambdaConsumerIntrospection
true
if a custom onError consumer implementation was supplied. Returns false
if the
implementation is missing an error consumer and thus using a throwing default implementation.Copyright © 2019. All rights reserved.