Top Fields Constructors Methods
reactor.core.publisher

pack-priv final Class SinkManySerialized<T>

extends AbstractSerializedSink
implements InternalManySink<T>, Scannable
Class Inheritance
All Implemented Interfaces
reactor.core.Scannable, reactor.core.publisher.InternalManySink, reactor.core.publisher.ContextHolder, reactor.core.publisher.Sinks.Many
Imports
reactor.core.Scannable, reactor.util.annotation.Nullable, reactor.util.context.Context, java.util.Objects, java.util.stream.Stream

Field Summary

Modifier and TypeField and Description
pack-priv final ContextHolder
pack-priv final Sinks.Many<T>
Inherited from reactor.core.publisher.SinksSpecs.AbstractSerializedSink:
LOCKED_ATlockedAtwipWIP

Constructor Summary

AccessConstructor and Description
pack-priv
SinkManySerialized(Sinks.Many<T> sink, ContextHolder contextHolder)

Method Summary

Modifier and TypeMethod and Description
public Flux<T>
asFlux()

Implements reactor.core.publisher.Sinks.Many.asFlux.

Return a Flux view of this sink.
public Context
currentContext()

Implements reactor.core.publisher.ContextHolder.currentContext.

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

Implements reactor.core.publisher.Sinks.Many.currentSubscriberCount.

Get how many Subscribers are currently subscribed to the sink.
public Stream<? extends Scannable>
inners()

Overrides default reactor.core.Scannable.inners.

Return a Stream of referenced inners (flatmap, multicast etc)
public boolean
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.
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
public final Sinks.EmitResult
tryEmitComplete()

Implements reactor.core.publisher.Sinks.Many.tryEmitComplete.

Try to terminate the sequence successfully, generating an onComplete signal.
public final Sinks.EmitResult
tryEmitError(Throwable
the exception to signal, not null
t
)

Implements reactor.core.publisher.Sinks.Many.tryEmitError.

Try to fail the sequence, generating an onError signal.
public final Sinks.EmitResult
tryEmitNext(T
the value to emit, not null
t
)

Implements reactor.core.publisher.Sinks.Many.tryEmitNext.

Try emitting a non-null element, generating an onNext signal.
Inherited from reactor.core.publisher.SinksSpecs.AbstractSerializedSink:
tryAcquire

Field Detail

contextHolderback to summary
pack-priv final ContextHolder contextHolder
sinkback to summary
pack-priv final Sinks.Many<T> sink

Constructor Detail

SinkManySerializedback to summary
pack-priv SinkManySerialized(Sinks.Many<T> sink, ContextHolder contextHolder)

Method Detail

asFluxback to summary
public Flux<T> asFlux()

Implements reactor.core.publisher.Sinks.Many.asFlux.

Doc from reactor.core.publisher.Sinks.Many.asFlux.

Return a Flux view of this sink. Every call returns the same instance.

Returns:Flux<T>

the Flux view associated to this Sinks.Many

Annotations
@Override
currentContextback to summary
public Context currentContext()

Implements reactor.core.publisher.ContextHolder.currentContext.

Doc from reactor.core.publisher.ContextHolder.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

Annotations
@Override
currentSubscriberCountback to summary
public int currentSubscriberCount()

Implements reactor.core.publisher.Sinks.Many.currentSubscriberCount.

Doc from reactor.core.publisher.Sinks.Many.currentSubscriberCount.

Get how many Subscribers are currently subscribed to the sink.

This is a best effort peek at the sink state, and a subsequent attempt at emitting to the sink might still return EmitResult#FAIL_ZERO_SUBSCRIBER where relevant. (generally in tryEmitNext(Object)). Request (and lack thereof) isn't taken into account, all registered subscribers are counted.

Returns:int

the number of subscribers at the time of invocation

Annotations
@Override
innersback to summary
public Stream<? extends Scannable> inners()

Overrides default reactor.core.Scannable.inners.

Doc from reactor.core.Scannable.inners.

Return a Stream of referenced inners (flatmap, multicast etc)

Returns:Stream<? extends Scannable>

a Stream of referenced inners (flatmap, multicast etc)

Annotations
@Override
isCancelledback to summary
public boolean isCancelled()
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
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object.

Annotations
@Override
tryEmitCompleteback to summary
public final Sinks.EmitResult tryEmitComplete()

Implements reactor.core.publisher.Sinks.Many.tryEmitComplete.

Doc from reactor.core.publisher.Sinks.Many.tryEmitComplete.

Try to terminate the sequence successfully, generating an onComplete signal. The result of the attempt is represented as an EmitResult, which possibly indicates error cases.

See the list of failure EmitResult in emitComplete(EmitFailureHandler) javadoc for an example of how each of these can be dealt with, to decide if the emit API would be a good enough fit instead.

Returns:Sinks.EmitResult

an EmitResult, which should be checked to distinguish different possible failures

Annotations
@Override
tryEmitErrorback to summary
public final Sinks.EmitResult tryEmitError(Throwable t)

Implements reactor.core.publisher.Sinks.Many.tryEmitError.

Doc from reactor.core.publisher.Sinks.Many.tryEmitError.

Try to fail the sequence, generating an onError signal. The result of the attempt is represented as an EmitResult, which possibly indicates error cases.

See the list of failure EmitResult in emitError(Throwable, EmitFailureHandler) javadoc for an example of how each of these can be dealt with, to decide if the emit API would be a good enough fit instead.

Parameters
t:Throwable

the exception to signal, not null

Returns:Sinks.EmitResult

an EmitResult, which should be checked to distinguish different possible failures

Annotations
@Override
tryEmitNextback to summary
public final Sinks.EmitResult tryEmitNext(T t)

Implements reactor.core.publisher.Sinks.Many.tryEmitNext.

Doc from reactor.core.publisher.Sinks.Many.tryEmitNext.

Try emitting a non-null element, generating an onNext signal. The result of the attempt is represented as an EmitResult, which possibly indicates error cases.

See the list of failure EmitResult in emitNext(Object, EmitFailureHandler) javadoc for an example of how each of these can be dealt with, to decide if the emit API would be a good enough fit instead.

Might throw an unchecked exception as a last resort (eg. in case of a fatal error downstream which cannot be propagated to any asynchronous handler, a bubbling exception, ...).

Parameters
t:T

the value to emit, not null

Returns:Sinks.EmitResult

an EmitResult, which should be checked to distinguish different possible failures

Annotations
@Override