Top Description Fields Constructors Methods
reactor.core.publisher

pack-priv final Class LambdaMonoSubscriber<T>

extends Object
implements InnerConsumer<T>, Disposable
Class Inheritance
All Implemented Interfaces
reactor.core.Disposable, reactor.core.publisher.InnerConsumer, reactor.core.Scannable, reactor.core.CoreSubscriber, org.reactivestreams.Subscriber
Type Parameters
<T>
the value type
Imports
java.util.concurrent.atomic.AtomicReferenceFieldUpdater, java.util.function.Consumer, org.reactivestreams.Subscriber, .Subscription, reactor.core.Disposable, .Exceptions, reactor.util.annotation.Nullable, reactor.util.context.Context

An unbounded Java Lambda adapter to Subscriber, targeted at Mono.

Field Summary

Modifier and TypeField and Description
pack-priv final Runnable
pack-priv final Consumer<? super T>
pack-priv final Consumer<? super Throwable>
pack-priv final Context
pack-priv static final AtomicReferenceFieldUpdater<LambdaMonoSubscriber<T>, Subscription>
S

pack-priv volatile Subscription
pack-priv final Consumer<? super Subscription>

Constructor Summary

AccessConstructor and Description
pack-priv
LambdaMonoSubscriber(Consumer<? super T>
A Consumer with argument onNext data
consumer
,
Consumer<? super Throwable>
A Consumer called onError
errorConsumer
,
Runnable
A Runnable called onComplete with the actual context if any
completeConsumer
,
Consumer<? super Subscription>
A Consumer called with the Subscription to perform initial request, or null to request max
subscriptionConsumer
,
Context
A Context for this subscriber, or null to use the default of an empty Context.
initialContext
)

Create a Subscriber reacting onNext, onError and onComplete.

pack-priv
LambdaMonoSubscriber(Consumer<? super T>
A Consumer with argument onNext data
consumer
,
Consumer<? super Throwable>
A Consumer called onError
errorConsumer
,
Runnable
A Runnable called onComplete with the actual context if any
completeConsumer
,
Consumer<? super Subscription>
A Consumer called with the Subscription to perform initial request, or null to request max
subscriptionConsumer
)

Create a Subscriber reacting onNext, onError and onComplete.

Method Summary

Modifier and TypeMethod and Description
public Context
currentContext()

Overrides default reactor.core.CoreSubscriber.currentContext.

Request a Context from dependent components which can include downstream operators during subscribing or a terminal org.reactivestreams.Subscriber.
public void
dispose()

Implements reactor.core.Disposable.dispose.

Cancel or dispose the underlying task or resource.
pack-priv void
public boolean
isDisposed()

Overrides default reactor.core.Disposable.isDisposed.

Optionally return true when the resource or task is disposed.
public final void
onComplete()

Implements org.reactivestreams.Subscriber.onComplete.

Successful terminal state.
public final void
onError(Throwable
the throwable signaled
t
)

Implements org.reactivestreams.Subscriber.onError.

Failed terminal state.
public final void
onNext(T
the element signaled
x
)

Implements org.reactivestreams.Subscriber.onNext.

Data notification sent by the Publisher in response to requests to Subscription#request(long).
public final void
onSubscribe(Subscription
the Subscription that allows requesting data via Subscription#request(long)
s
)

Implements reactor.core.CoreSubscriber.onSubscribe.

Implementors should initialize any state used by onNext(Object) before calling Subscription#request(long).
public Object
scanUnsafe(Scannable.Attr<T>
a Attr to resolve for the component.
key
)

Implements reactor.core.Scannable.scanUnsafe.

This method is used internally by components to define their key-value mappings in a single place.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

completeConsumerback to summary
pack-priv final Runnable completeConsumer
consumerback to summary
pack-priv final Consumer<? super T> consumer
errorConsumerback to summary
pack-priv final Consumer<? super Throwable> errorConsumer
initialContextback to summary
pack-priv final Context initialContext
Sback to summary
pack-priv static final AtomicReferenceFieldUpdater<LambdaMonoSubscriber<T>, Subscription> S
subscriptionback to summary
pack-priv volatile Subscription subscription
subscriptionConsumerback to summary
pack-priv final Consumer<? super Subscription> subscriptionConsumer

Constructor Detail

LambdaMonoSubscriberback to summary
pack-priv LambdaMonoSubscriber(Consumer<? super T> consumer, Consumer<? super Throwable> errorConsumer, Runnable completeConsumer, Consumer<? super Subscription> subscriptionConsumer, Context initialContext)

Create a Subscriber reacting onNext, onError and onComplete. The subscriber will automatically request Long.MAX_VALUE onSubscribe.

The argument subscriptionHandler is executed once by new subscriber to generate a context shared by every request calls.

Parameters
consumer:Consumer<? super T>

A Consumer with argument onNext data

errorConsumer:Consumer<? super Throwable>

A Consumer called onError

completeConsumer:Runnable

A Runnable called onComplete with the actual context if any

subscriptionConsumer:Consumer<? super Subscription>

A Consumer called with the Subscription to perform initial request, or null to request max

initialContext:Context

A Context for this subscriber, or null to use the default of an empty Context.

LambdaMonoSubscriberback to summary
pack-priv LambdaMonoSubscriber(Consumer<? super T> consumer, Consumer<? super Throwable> errorConsumer, Runnable completeConsumer, Consumer<? super Subscription> subscriptionConsumer)

Create a Subscriber reacting onNext, onError and onComplete. The subscriber will automatically request Long.MAX_VALUE onSubscribe.

The argument subscriptionHandler is executed once by new subscriber to generate a context shared by every request calls.

Parameters
consumer:Consumer<? super T>

A Consumer with argument onNext data

errorConsumer:Consumer<? super Throwable>

A Consumer called onError

completeConsumer:Runnable

A Runnable called onComplete with the actual context if any

subscriptionConsumer:Consumer<? super Subscription>

A Consumer called with the Subscription to perform initial request, or null to request max

Method Detail

currentContextback to summary
public Context currentContext()

Overrides default reactor.core.CoreSubscriber.currentContext.

Doc from reactor.core.CoreSubscriber.currentContext.

Request a Context from dependent components which can include downstream operators during subscribing or a terminal org.reactivestreams.Subscriber.

Returns:Context

a resolved context or Context#empty()

Annotations
@Override
disposeback to summary
public void dispose()

Implements reactor.core.Disposable.dispose.

Doc from reactor.core.Disposable.dispose.

Cancel or dispose the underlying task or resource.

Implementations are required to make this method idempotent.

Annotations
@Override
doErrorback to summary
pack-priv void doError(Throwable t)
isDisposedback to summary
public boolean isDisposed()

Overrides default reactor.core.Disposable.isDisposed.

Doc from reactor.core.Disposable.isDisposed.

Optionally return true when the resource or task is disposed.

Implementations are not required to track disposition and as such may never return true even when disposed. However, they MUST only return true when there's a guarantee the resource or task is disposed.

Returns:boolean

true when there's a guarantee the resource or task is disposed.

Annotations
@Override
onCompleteback to summary
public final void onComplete()

Implements org.reactivestreams.Subscriber.onComplete.

Doc from org.reactivestreams.Subscriber.onComplete.

Successful terminal state.

No further events will be sent even if Subscription#request(long) is invoked again.

Annotations
@Override
onErrorback to summary
public final void onError(Throwable t)

Implements org.reactivestreams.Subscriber.onError.

Doc from org.reactivestreams.Subscriber.onError.

Failed terminal state.

No further events will be sent even if Subscription#request(long) is invoked again.

Parameters
t:Throwable

the throwable signaled

Annotations
@Override
onNextback to summary
public final void onNext(T x)

Implements org.reactivestreams.Subscriber.onNext.

Doc from org.reactivestreams.Subscriber.onNext.

Data notification sent by the Publisher in response to requests to Subscription#request(long).

Parameters
x:T

the element signaled

Annotations
@Override
onSubscribeback to summary
public final void onSubscribe(Subscription s)

Implements reactor.core.CoreSubscriber.onSubscribe.

Doc from reactor.core.CoreSubscriber.onSubscribe.

Implementors should initialize any state used by onNext(Object) before calling Subscription#request(long). Should further onNext related state modification occur, thread-safety will be required.

Note that an invalid request <= 0 will not produce an onError and will simply be ignored or reported through a debug-enabled reactor.util.Logger. Invoked after calling Publisher#subscribe(Subscriber).

No data will start flowing until Subscription#request(long) is invoked.

It is the responsibility of this Subscriber instance to call Subscription#request(long) whenever more data is wanted.

The Publisher will send notifications only in response to Subscription#request(long).

Parameters
s:Subscription

Doc from org.reactivestreams.Subscriber.onSubscribe.

the Subscription that allows requesting data via Subscription#request(long)

Annotations
@Override
scanUnsafeback to summary
public Object scanUnsafe(Scannable.Attr<T> key)

Implements reactor.core.Scannable.scanUnsafe.

Doc from reactor.core.Scannable.scanUnsafe.

This method is used internally by components to define their key-value mappings in a single place. Although it is ignoring the generic type of the Attr key, implementors should take care to return values of the correct type, and return null if no specific value is available.

For public consumption of attributes, prefer using scan(Attr), which will return a typed value and fall back to the key's default if the component didn't define any mapping.

Parameters
key:Scannable.Attr<T>

a Attr to resolve for the component.

Returns:Object

the value associated to the key for that specific component, or null if none.

Annotations
@Override
@Nullable