T
- the output value typepublic interface SynchronousSink<T>
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 FluxSink
or
MonoSink
based generators for these situations.
Modifier and Type | Method and Description |
---|---|
void |
complete() |
default ContextView |
contextView()
Return the current subscriber's context as a
ContextView for inspection. |
Context |
currentContext()
Deprecated.
To be removed in 3.6.0 at the earliest. Prefer using #getContextView() instead.
|
void |
error(Throwable e) |
void |
next(T t)
Try emitting, might throw an unchecked exception.
|
void complete()
Subscriber.onComplete()
@Deprecated Context currentContext()
Context
.
Context
can be enriched via Mono.contextWrite(Function)
or Flux.contextWrite(Function)
operator or directly by a child subscriber overriding
CoreSubscriber.currentContext()
Context
.default ContextView contextView()
ContextView
for inspection.
Context
can be enriched downstream via Mono.contextWrite(Function)
or Flux.contextWrite(Function)
operators or directly by a child subscriber overriding
CoreSubscriber.currentContext()
ContextView
.void error(Throwable e)
e
- the exception to signal, not nullSubscriber.onError(Throwable)
void next(T t)
t
- the value to emit, not nullRuntimeException
- in case of unchecked error during the emissionSubscriber.onNext(Object)