程序包 | 说明 |
---|---|
reactor.core.publisher |
限定符和类型 | 方法和说明 |
---|---|
MonoSink<T> |
MonoSink.onCancel(Disposable d)
取消订阅事件,调用
Subscription.cancel() 方法触发,多次注册以最后一次为准,当元素发布后再调用取消订阅时不生效
Attach a Disposable as a callback for when this MonoSink is
cancelled. |
MonoSink<T> |
MonoSink.onDispose(Disposable d)
在完成时,在发生异常时(onComplete, onError),在Subscription调用
Subscription.cancel() 方法取消时触发,可重复注册
Attach a Disposable as a callback for when this MonoSink is effectively
disposed, that is it cannot be used anymore. |
MonoSink<T> |
MonoSink.onRequest(java.util.function.LongConsumer consumer)
请求事件,订阅者订阅后发起请求数据时触发,会传入一个Long型的背压数,默认是Long.MAX_VALUE
Attaches a
LongConsumer to this MonoSink that will be notified of
any request to this sink. |
限定符和类型 | 方法和说明 |
---|---|
static <T> Mono<T> |
Mono.create(java.util.function.Consumer<MonoSink<T>> callback)
允许同步或异步通过
MonoSink 创建一个Mono
Creates a deferred emitter that can be used with callback-based
APIs to signal at most one value, a complete or an error signal. |