Package reactor.core.publisher
Interface SynchronousSink<T>
- Type Parameters:
T- the output value type
public interface SynchronousSink<T>
Interface to produce synchronously "one signal" to an underlying
Subscriber.
At most one next(T) call and/or one complete() or
error(Throwable) should be called per invocation of the generator function.
Calling a SynchronousSink outside of a generator consumer or function, e.g.
using an async callback, is forbidden. You can use FluxSink or
MonoSink based generators for these situations.
-
Method Summary
Modifier and TypeMethodDescriptionvoidcomplete()default ContextViewReturn the current subscriber's context as aContextViewfor inspection.Deprecated.To be removed in 3.6.0 at the earliest.voidvoidTry emitting, might throw an unchecked exception.
-
Method Details
-
complete
void complete()- See Also:
-
currentContext
Deprecated.To be removed in 3.6.0 at the earliest. Prefer using #contextView() instead.Return the current subscriberContext.Contextcan be enriched viaMono.contextWrite(Function)orFlux.contextWrite(Function)operator or directly by a child subscriber overridingCoreSubscriber.currentContext()- Returns:
- the current subscriber
Context.
-
contextView
Return the current subscriber's context as aContextViewfor inspection.Contextcan be enriched downstream viaMono.contextWrite(Function)orFlux.contextWrite(Function)operators or directly by a child subscriber overridingCoreSubscriber.currentContext()- Returns:
- the current subscriber
ContextView.
-
error
- Parameters:
e- the exception to signal, not null- See Also:
-
next
Try emitting, might throw an unchecked exception.- Parameters:
t- the value to emit, not null- Throws:
RuntimeException- in case of unchecked error during the emission- See Also:
-