Top Fields Constructors Methods
reactor.core.publisher

pack-priv abstract Class BlockingSingleSubscriber<T>

extends CountDownLatch
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
Known Direct Subclasses
reactor.core.publisher.BlockingFirstSubscriber, reactor.core.publisher.BlockingLastSubscriber, reactor.core.publisher.BlockingMonoSubscriber
Imports
java.util.concurrent.CountDownLatch, .TimeUnit, org.reactivestreams.Subscription, reactor.core.Disposable, .Exceptions, reactor.core.scheduler.Schedulers, reactor.util.annotation.Nullable, reactor.util.context.Context

See Also
https://github.com/reactor/reactive-streams-commons

Field Summary

Modifier and TypeField and Description
pack-priv volatile boolean
pack-priv final Context
pack-priv Throwable
pack-priv Subscription
s

pack-priv T

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
pack-priv final T

Returns:

the first value or null if the source is empty
blockingGet
()

Block until the first value arrives and return it, otherwise return null for an empty source and rethrow any exception.

pack-priv final T

Returns:

the first value or null if the source is empty
blockingGet
(long
the timeout to wait
timeout
,
TimeUnit
the time unit
unit
)

Block until the first value arrives and return it, otherwise return null for an empty source and rethrow any exception.

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 final void
dispose()

Implements reactor.core.Disposable.dispose.

Cancel or dispose the underlying task or resource.
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
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.util.concurrent.CountDownLatch:
awaitawaitcountDowngetCounttoString

Field Detail

cancelledback to summary
pack-priv volatile boolean cancelled
contextback to summary
pack-priv final Context context
errorback to summary
pack-priv Throwable error
sback to summary
pack-priv Subscription s
valueback to summary
pack-priv T value

Constructor Detail

BlockingSingleSubscriberback to summary
pack-priv BlockingSingleSubscriber(Context context)

Method Detail

blockingGetback to summary
pack-priv final T blockingGet()

Block until the first value arrives and return it, otherwise return null for an empty source and rethrow any exception.

Returns:T

the first value or null if the source is empty

Annotations
@Nullable
blockingGetback to summary
pack-priv final T blockingGet(long timeout, TimeUnit unit)

Block until the first value arrives and return it, otherwise return null for an empty source and rethrow any exception.

Parameters
timeout:long

the timeout to wait

unit:TimeUnit

the time unit

Returns:T

the first value or null if the source is empty

Annotations
@Nullable
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 final 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
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
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