T
- the value type emittedpublic interface MonoSink<T>
Modifier and Type | Method and Description |
---|---|
Context |
currentContext()
Return the current subscriber
Context . |
void |
error(Throwable e)
Terminate with the give exception
|
MonoSink<T> |
onCancel(Disposable d)
Associates a disposable resource with this MonoSink that will be disposed on
downstream.cancel().
|
MonoSink<T> |
onDispose(Disposable d)
Associates a disposable resource with this MonoSink that will be disposed on the
first terminate signal which may be a cancel, complete or error signal.
|
MonoSink<T> |
onRequest(LongConsumer consumer)
Attaches a
LongConsumer to this MonoSink that will be notified of
any request to this sink. |
void |
success()
Complete without any value.
|
void |
success(T value)
Complete with the given value.
|
Context currentContext()
Context
.
Context
can be enriched via Mono.subscriberContext(Function)
operator or directly by a child subscriber overriding
CoreSubscriber.currentContext()
Context
.void success()
Calling this method multiple times or after the other terminating methods has no effect.
void success(@Nullable T value)
Calling this method multiple times or after the other
terminating methods has no effect (the value is purely ignored). Calling this method with
a null
value will be silently accepted as a call to
success()
by standard implementations.
value
- the value to complete withvoid error(Throwable e)
Calling this method multiple times or after the other terminating methods is
an unsupported operation. It will discard the exception through the
Hooks.onErrorDropped(Consumer)
hook (which by default throws the exception
wrapped via Exceptions.bubble(Throwable)
). This is to avoid
complete and silent swallowing of the exception.
e
- the exception to complete withMonoSink<T> onRequest(LongConsumer consumer)
LongConsumer
to this MonoSink
that will be notified of
any request to this sink.consumer
- the consumer to invoke on each requestMonoSink
with a consumer that is notified of requestsMonoSink<T> onCancel(Disposable d)
d
- the disposable callback to useMonoSink
with resource to be disposed on cancel signalMonoSink<T> onDispose(Disposable d)
d
- the disposable callback to useMonoSink
with resource to be disposed on first terminate signal