程序包 | 说明 |
---|---|
reactor.core |
Core components of the framework supporting extensions to the Reactive Stream
programming model.
|
reactor.core.publisher | |
reactor.core.scheduler |
Scheduler contract and static
registry and factory methods in Schedulers . |
reactor.test |
Main test components supporting the testing and assertion of publishers.
|
reactor.test.scheduler |
Components supporting the creation of test-oriented
Schedulers . |
reactor.test.util |
限定符和类型 | 接口和说明 |
---|---|
static interface |
Disposable.Composite
A container of
Disposable that is itself Disposable . |
static interface |
Disposable.Swap
A
Disposable container that allows updating/replacing its inner Disposable
atomically and with respect of disposing the container itself. |
限定符和类型 | 方法和说明 |
---|---|
static Disposable |
Disposables.disposed()
Return a new
Disposable that is already disposed. |
static Disposable |
Disposables.never()
Return a new
Disposable that can never be disposed. |
static Disposable |
Disposables.single()
Return a new simple
Disposable instance that is initially not disposed but
can be by calling dispose() . |
限定符和类型 | 方法和说明 |
---|---|
boolean |
Disposable.Composite.add(Disposable d)
Add a
Disposable to this container, if it is not disposed . |
static Disposable.Composite |
Disposables.composite(Disposable... disposables)
Create and initialize a new
Disposable.Composite with atomic guarantees on
all mutative operations. |
boolean |
Disposable.Composite.remove(Disposable d)
Delete the
Disposable from this container, without disposing it. |
boolean |
Disposable.Swap.replace(Disposable next)
Atomically set the next
Disposable on this container but don't dispose the previous
one (if any). |
boolean |
Disposable.Swap.update(Disposable next)
Atomically set the next
Disposable on this container and dispose the previous
one (if any). |
限定符和类型 | 方法和说明 |
---|---|
default boolean |
Disposable.Composite.addAll(java.util.Collection<? extends Disposable> ds)
Adds the given collection of Disposables to the container or disposes them
all if the container has been disposed.
|
static Disposable.Composite |
Disposables.composite(java.lang.Iterable<? extends Disposable> disposables)
Create and initialize a new
Disposable.Composite with atomic guarantees on
all mutative operations. |
限定符和类型 | 类和说明 |
---|---|
class |
BaseSubscriber<T>
A simple base class for a
Subscriber implementation that lets the user
perform a BaseSubscriber.request(long) and BaseSubscriber.cancel() on it directly. |
class |
DirectProcessor<T>
已过时。
To be removed in 3.5, prefer clear cut usage of
Sinks . Closest sink
is Sinks.many().multicast().directBestEffort() ,
except it doesn't terminate overflowing downstreams. |
class |
EmitterProcessor<T>
已过时。
To be removed in 3.5. Prefer clear cut usage of
Sinks through
variations of Sinks.many().multicast().onBackpressureBuffer() .
If you really need the subscribe-to-upstream functionality of a Processor , switch
to Sinks.ManyWithUpstream with Sinks.unsafe() variants of Sinks.unsafe().manyWithUpstream() .
This processor was blocking in EmitterProcessor.onNext(Object) . This behaviour can be implemented with the Sinks API by calling
Sinks.Many.tryEmitNext(Object) and retrying, e.g.:
|
class |
FluxProcessor<IN,OUT>
已过时。
Processors will be removed in 3.5. Prefer using
Sinks.Many instead,
or see https://github.com/reactor/reactor-core/issues/2431 for alternatives |
class |
MonoProcessor<O>
已过时。
Processors will be removed in 3.5. Prefer using
Sinks.One or Sinks.Empty instead,
or see https://github.com/reactor/reactor-core/issues/2431 for alternatives |
class |
ReplayProcessor<T>
已过时。
To be removed in 3.5, prefer clear cut usage of
Sinks through
variations under Sinks.many().replay() . |
class |
UnicastProcessor<T>
已过时。
to be removed in 3.5, prefer clear cut usage of
Sinks through
variations under Sinks.many().unicast() . |
限定符和类型 | 方法和说明 |
---|---|
Disposable |
ConnectableFlux.connect()
Connect this
ConnectableFlux to its source and return a Disposable that
can be used for disconnecting. |
Disposable |
ParallelFlux.subscribe()
Subscribes to this
ParallelFlux and triggers the execution chain for all
'rails'. |
Disposable |
Mono.subscribe()
Subscribe to this
Mono and request unbounded demand. |
Disposable |
Flux.subscribe()
Subscribe to this
Flux and request unbounded demand. |
Disposable |
ParallelFlux.subscribe(java.util.function.Consumer<? super T> onNext)
Subscribes to this
ParallelFlux by providing an onNext callback and
triggers the execution chain for all 'rails'. |
Disposable |
Mono.subscribe(java.util.function.Consumer<? super T> consumer)
Subscribe a
Consumer to this Mono that will consume all the
sequence. |
Disposable |
Flux.subscribe(java.util.function.Consumer<? super T> consumer)
Subscribe a
Consumer to this Flux that will consume all the
elements in the sequence. |
Disposable |
ParallelFlux.subscribe(java.util.function.Consumer<? super T> onNext,
java.util.function.Consumer<? super java.lang.Throwable> onError)
Subscribes to this
ParallelFlux by providing an onNext and onError callback
and triggers the execution chain for all 'rails'. |
Disposable |
Mono.subscribe(java.util.function.Consumer<? super T> consumer,
java.util.function.Consumer<? super java.lang.Throwable> errorConsumer)
Subscribe to this
Mono with a Consumer that will consume all the
elements in the sequence, as well as a Consumer that will handle errors. |
Disposable |
Flux.subscribe(java.util.function.Consumer<? super T> consumer,
java.util.function.Consumer<? super java.lang.Throwable> errorConsumer)
Subscribe to this
Flux with a Consumer that will consume all the
elements in the sequence, as well as a Consumer that will handle errors. |
Disposable |
ParallelFlux.subscribe(java.util.function.Consumer<? super T> onNext,
java.util.function.Consumer<? super java.lang.Throwable> onError,
java.lang.Runnable onComplete)
Subscribes to this
ParallelFlux by providing an onNext, onError and
onComplete callback and triggers the execution chain for all 'rails'. |
Disposable |
Mono.subscribe(java.util.function.Consumer<? super T> consumer,
java.util.function.Consumer<? super java.lang.Throwable> errorConsumer,
java.lang.Runnable completeConsumer)
Subscribe
Consumer to this Mono that will respectively consume all the
elements in the sequence, handle errors and react to completion. |
Disposable |
Flux.subscribe(java.util.function.Consumer<? super T> consumer,
java.util.function.Consumer<? super java.lang.Throwable> errorConsumer,
java.lang.Runnable completeConsumer)
Subscribe
Consumer to this Flux that will respectively consume all the
elements in the sequence, handle errors and react to completion. |
Disposable |
ParallelFlux.subscribe(java.util.function.Consumer<? super T> onNext,
java.util.function.Consumer<? super java.lang.Throwable> onError,
java.lang.Runnable onComplete,
java.util.function.Consumer<? super org.reactivestreams.Subscription> onSubscribe)
Subscribes to this
ParallelFlux by providing an onNext, onError,
onComplete and onSubscribe callback and triggers the execution chain for all
'rails'. |
Disposable |
Mono.subscribe(java.util.function.Consumer<? super T> consumer,
java.util.function.Consumer<? super java.lang.Throwable> errorConsumer,
java.lang.Runnable completeConsumer,
java.util.function.Consumer<? super org.reactivestreams.Subscription> subscriptionConsumer)
Subscribe
Consumer to this Mono that will respectively consume all the
elements in the sequence, handle errors, react to completion, and request upon subscription. |
Disposable |
Flux.subscribe(java.util.function.Consumer<? super T> consumer,
java.util.function.Consumer<? super java.lang.Throwable> errorConsumer,
java.lang.Runnable completeConsumer,
java.util.function.Consumer<? super org.reactivestreams.Subscription> subscriptionConsumer)
已过时。
Because users tend to forget to
request the subsciption. If
the behavior is really needed, consider using Flux.subscribeWith(Subscriber) . To be removed in 3.5. |
Disposable |
ParallelFlux.subscribe(java.util.function.Consumer<? super T> onNext,
java.util.function.Consumer<? super java.lang.Throwable> onError,
java.lang.Runnable onComplete,
Context initialContext)
Subscribes to this
ParallelFlux by providing an onNext, onError and
onComplete callback as well as an initial Context , then trigger the execution chain for all
'rails'. |
Disposable |
Mono.subscribe(java.util.function.Consumer<? super T> consumer,
java.util.function.Consumer<? super java.lang.Throwable> errorConsumer,
java.lang.Runnable completeConsumer,
Context initialContext)
Subscribe
Consumer to this Mono that will respectively consume all the
elements in the sequence, handle errors and react to completion. |
Disposable |
Flux.subscribe(java.util.function.Consumer<? super T> consumer,
java.util.function.Consumer<? super java.lang.Throwable> errorConsumer,
java.lang.Runnable completeConsumer,
Context initialContext)
Subscribe
Consumer to this Flux that will respectively consume all the
elements in the sequence, handle errors and react to completion. |
Disposable |
EmitterProcessor.subscribeTo(org.reactivestreams.Publisher<? extends T> upstream)
已过时。
|
Disposable |
Sinks.ManyWithUpstream.subscribeTo(org.reactivestreams.Publisher<? extends T> upstream)
Explicitly subscribe this
Sinks.Many to an upstream Publisher without
exposing it as a Subscriber at all. |
限定符和类型 | 方法和说明 |
---|---|
static <E> UnicastProcessor<E> |
UnicastProcessor.create(java.util.Queue<E> queue,
java.util.function.Consumer<? super E> onOverflow,
Disposable endcallback)
已过时。
use
Sinks.many().unicast().onBackpressureBuffer(queue, endCallback)
(or the unsafe variant if you're sure about external synchronization). The onOverflow callback is not
supported anymore. To be removed in 3.5. |
static <E> UnicastProcessor<E> |
UnicastProcessor.create(java.util.Queue<E> queue,
Disposable endcallback)
已过时。
use
Sinks.many().unicast().onBackpressureBuffer(queue, endCallback)
(or the unsafe variant if you're sure about external synchronization). To be removed in 3.5. |
<T> Sinks.Many<T> |
Sinks.UnicastSpec.onBackpressureBuffer(java.util.Queue<T> queue,
Disposable endCallback)
A
Sinks.Many with the following characteristics:
Unicast: contrary to most other Sinks.Many , the
Flux view rejects subscribers past the first one. |
FluxSink<T> |
FluxSink.onCancel(Disposable d)
Attach a
Disposable as a callback for when this FluxSink is
cancelled. |
MonoSink<T> |
MonoSink.onCancel(Disposable d)
取消订阅事件,调用
Subscription.cancel() 方法触发,多次注册以最后一次为准,当元素发布后再调用取消订阅时不生效
Attach a Disposable as a callback for when this MonoSink is
cancelled. |
FluxSink<T> |
FluxSink.onDispose(Disposable d)
Attach a
Disposable as a callback for when this FluxSink is effectively
disposed, that is it cannot be used anymore. |
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. |
限定符和类型 | 方法和说明 |
---|---|
Flux<T> |
ConnectableFlux.autoConnect(int minSubscribers,
java.util.function.Consumer<? super Disposable> cancelSupport)
Connects this
ConnectableFlux to the upstream source when the specified amount of
Subscriber subscribes and calls the supplied consumer with a Disposable
that allows disconnecting. |
abstract void |
ConnectableFlux.connect(java.util.function.Consumer<? super Disposable> cancelSupport)
Connects this
ConnectableFlux to its source and sends a Disposable to a callback that
can be used for disconnecting. |
构造器和说明 |
---|
UnicastProcessor(java.util.Queue<T> queue,
java.util.function.Consumer<? super T> onOverflow,
Disposable onTerminate)
已过时。
|
UnicastProcessor(java.util.Queue<T> queue,
Disposable onTerminate)
已过时。
|
限定符和类型 | 接口和说明 |
---|---|
interface |
Scheduler
Provides an abstract asynchronous boundary to operators.
|
static interface |
Scheduler.Worker
A worker representing an asynchronous boundary that executes tasks.
|
限定符和类型 | 类和说明 |
---|---|
static class |
Schedulers.Snapshot
It is also
Disposable in case you don't want to restore the live Schedulers |
限定符和类型 | 方法和说明 |
---|---|
Disposable |
Scheduler.schedule(java.lang.Runnable task)
Schedules the non-delayed execution of the given task on this scheduler.
|
Disposable |
Scheduler.Worker.schedule(java.lang.Runnable task)
Schedules the task for immediate execution on this worker.
|
default Disposable |
Scheduler.schedule(java.lang.Runnable task,
long delay,
java.util.concurrent.TimeUnit unit)
Schedules the execution of the given task with the given delay amount.
|
default Disposable |
Scheduler.Worker.schedule(java.lang.Runnable task,
long delay,
java.util.concurrent.TimeUnit unit)
Schedules the execution of the given task with the given delay amount.
|
default Disposable |
Scheduler.schedulePeriodically(java.lang.Runnable task,
long initialDelay,
long period,
java.util.concurrent.TimeUnit unit)
Schedules a periodic execution of the given task with the given initial delay and period.
|
default Disposable |
Scheduler.Worker.schedulePeriodically(java.lang.Runnable task,
long initialDelay,
long period,
java.util.concurrent.TimeUnit unit)
Schedules a periodic execution of the given task with the given initial delay and period.
|
限定符和类型 | 类和说明 |
---|---|
class |
FakeDisposable |
限定符和类型 | 方法和说明 |
---|---|
<T extends Disposable> |
AutoDisposingExtension.autoDispose(T disposable)
Register a
Disposable for automatic cleanup and return it for chaining. |
限定符和类型 | 类和说明 |
---|---|
class |
VirtualTimeScheduler
A
Scheduler that uses a virtual clock, allowing to manipulate time
(eg. in tests). |
限定符和类型 | 方法和说明 |
---|---|
Disposable |
VirtualTimeScheduler.schedule(java.lang.Runnable task) |
Disposable |
VirtualTimeScheduler.schedule(java.lang.Runnable task,
long delay,
java.util.concurrent.TimeUnit unit) |
Disposable |
VirtualTimeScheduler.schedulePeriodically(java.lang.Runnable task,
long initialDelay,
long period,
java.util.concurrent.TimeUnit unit) |
限定符和类型 | 方法和说明 |
---|---|
static Disposable |
LoggerUtils.useCurrentLoggersWithCapture()
Sets a
logger factory that will return loggers that not only use the
original logging framework used by reactor, but also use the logger set via LoggerUtils.enableCaptureWith(Logger) , irrespective
of its name or how it was obtained. |