程序包 | 说明 |
---|---|
reactor.core.observability.micrometer |
Support of Micrometer 1.10+ instrumentation on reactor-core classes.
|
reactor.core.publisher | |
reactor.core.scheduler |
Scheduler contract and static
registry and factory methods in Schedulers . |
reactor.test.scheduler |
Components supporting the creation of test-oriented
Schedulers . |
reactor.test.util | |
reactor.util.retry |
限定符和类型 | 方法和说明 |
---|---|
static Scheduler |
Micrometer.timedScheduler(Scheduler original,
io.micrometer.core.instrument.MeterRegistry meterRegistry,
java.lang.String metricsPrefix)
Wrap a
Scheduler in an instance that gathers various task-related metrics using
the provided MeterRegistry and naming meters using the provided metricsPrefix . |
static Scheduler |
Micrometer.timedScheduler(Scheduler original,
io.micrometer.core.instrument.MeterRegistry meterRegistry,
java.lang.String metricsPrefix,
java.lang.Iterable<io.micrometer.core.instrument.Tag> tags)
Wrap a
Scheduler in an instance that gathers various task-related metrics using
the provided MeterRegistry and naming meters using the provided metricsPrefix . |
限定符和类型 | 方法和说明 |
---|---|
static Scheduler |
Micrometer.timedScheduler(Scheduler original,
io.micrometer.core.instrument.MeterRegistry meterRegistry,
java.lang.String metricsPrefix)
Wrap a
Scheduler in an instance that gathers various task-related metrics using
the provided MeterRegistry and naming meters using the provided metricsPrefix . |
static Scheduler |
Micrometer.timedScheduler(Scheduler original,
io.micrometer.core.instrument.MeterRegistry meterRegistry,
java.lang.String metricsPrefix,
java.lang.Iterable<io.micrometer.core.instrument.Tag> tags)
Wrap a
Scheduler in an instance that gathers various task-related metrics using
the provided MeterRegistry and naming meters using the provided metricsPrefix . |
限定符和类型 | 方法和说明 |
---|---|
Flux<java.util.List<T>> |
Flux.buffer(java.time.Duration bufferingTimespan,
java.time.Duration openBufferEvery,
Scheduler timer)
Collect incoming values into multiple
List buffers created at a given
openBufferEvery period, as measured on the provided Scheduler . |
Flux<java.util.List<T>> |
Flux.buffer(java.time.Duration bufferingTimespan,
Scheduler timer)
|
Flux<java.util.List<T>> |
Flux.bufferTimeout(int maxSize,
java.time.Duration maxTime,
Scheduler timer)
|
<C extends java.util.Collection<? super T>> |
Flux.bufferTimeout(int maxSize,
java.time.Duration maxTime,
Scheduler timer,
java.util.function.Supplier<C> bufferSupplier)
|
Mono<T> |
Mono.cache(java.time.Duration ttl,
Scheduler timer)
根据 Duration 指定 Mono 缓存失效时间,使用指定调度器检测过期时间
Turn this
Mono into a hot source and cache last emitted signals for further
Subscriber , with an expiry timeout. |
Flux<T> |
Flux.cache(java.time.Duration ttl,
Scheduler timer)
Turn this
Flux into a hot source and cache last emitted signals for further
Subscriber . |
Mono<T> |
Mono.cache(java.util.function.Function<? super T,java.time.Duration> ttlForValue,
java.util.function.Function<java.lang.Throwable,java.time.Duration> ttlForError,
java.util.function.Supplier<java.time.Duration> ttlForEmpty,
Scheduler timer)
可指定当Mono成功发布,异常,返回Empty场景的缓存时间,并指定检测超时的线程池
Turn this
Mono into a hot source and cache last emitted signal for further
Subscriber , with an expiry timeout (TTL) that depends on said signal. |
Flux<T> |
Flux.cache(int history,
java.time.Duration ttl,
Scheduler timer)
Turn this
Flux into a hot source and cache last emitted signals for further
Subscriber . |
Mono<T> |
Mono.cancelOn(Scheduler scheduler)
|
Flux<T> |
Flux.cancelOn(Scheduler scheduler)
|
static <T> ReplayProcessor<T> |
ReplayProcessor.createSizeAndTimeout(int size,
java.time.Duration maxAge,
Scheduler scheduler)
已过时。
use
Sinks.many().replay().limit(size, maxAge, scheduler)
(or the unsafe variant if you're sure about external synchronization). To be removed in 3.5. |
static <T> ReplayProcessor<T> |
ReplayProcessor.createTimeout(java.time.Duration maxAge,
Scheduler scheduler)
已过时。
use
Sinks.many().replay().limit(maxAge, scheduler)
(or the unsafe variant if you're sure about external synchronization). To be removed in 3.5. |
static Mono<java.lang.Long> |
Mono.delay(java.time.Duration duration,
Scheduler timer)
在指定Scheduler上创建一个Mono,它将onNext信号延迟给定的时间。
|
Mono<T> |
Mono.delayElement(java.time.Duration delay,
Scheduler timer)
|
Flux<T> |
Flux.delayElements(java.time.Duration delay,
Scheduler timer)
|
Flux<T> |
Flux.delaySequence(java.time.Duration delay,
Scheduler timer)
Shift this
Flux forward in time by a given Duration . |
Mono<T> |
Mono.delaySubscription(java.time.Duration delay,
Scheduler timer)
|
Flux<T> |
Flux.delaySubscription(java.time.Duration delay,
Scheduler timer)
Delay the
subscription to this Flux source until the given
period elapses, as measured on the user-provided Scheduler . |
Mono<Tuple2<java.lang.Long,T>> |
Mono.elapsed(Scheduler scheduler)
返回一个 Tuple2, 第一个值是生成数据的耗时,并指定线程池去记录耗时
Map this
Mono sequence into Tuple2<Long, T>
of timemillis and source data. |
Flux<Tuple2<java.lang.Long,T>> |
Flux.elapsed(Scheduler scheduler)
Map this
Flux into Tuple2<Long, T>
of timemillis and source data. |
static Flux<java.lang.Long> |
Flux.interval(java.time.Duration delay,
java.time.Duration period,
Scheduler timer)
|
static Flux<java.lang.Long> |
Flux.interval(java.time.Duration period,
Scheduler timer)
|
<T> Sinks.Many<T> |
Sinks.MulticastReplaySpec.limit(java.time.Duration maxAge,
Scheduler scheduler)
A
Sinks.Many with the following characteristics:
Multicast
Without Subscriber : all elements pushed to this sink are remembered until their maxAge is reached,
even when there is no subscriber. |
<T> Sinks.Many<T> |
Sinks.MulticastReplaySpec.limit(int historySize,
java.time.Duration maxAge,
Scheduler scheduler)
A
Sinks.Many with the following characteristics:
Multicast
Without Subscriber : up to historySize elements pushed to this sink are remembered,
until their maxAge is reached, even when there is no subscriber. |
Flux<T> |
Flux.onBackpressureBuffer(java.time.Duration ttl,
int maxSize,
java.util.function.Consumer<? super T> onBufferEviction,
Scheduler scheduler)
|
Mono<T> |
Mono.publishOn(Scheduler scheduler)
|
Flux<T> |
Flux.publishOn(Scheduler scheduler)
|
Flux<T> |
Flux.publishOn(Scheduler scheduler,
boolean delayError,
int prefetch)
Run onNext, onComplete and onError on a supplied
Scheduler
Scheduler.Worker . |
Flux<T> |
Flux.publishOn(Scheduler scheduler,
int prefetch)
Run onNext, onComplete and onError on a supplied
Scheduler
Scheduler.Worker . |
static void |
MonoSubscriberTest.race(java.lang.Runnable r1,
java.lang.Runnable r2,
Scheduler s)
Synchronizes the execution of two runnables (as much as possible)
to test race conditions.
|
Flux<T> |
ConnectableFlux.refCount(int minSubscribers,
java.time.Duration gracePeriod,
Scheduler scheduler)
Connects to the upstream source when the given number of
Subscriber subscribes. |
ConnectableFlux<T> |
Flux.replay(java.time.Duration ttl,
Scheduler timer)
Turn this
Flux into a connectable hot source and cache last emitted signals
for further Subscriber . |
ConnectableFlux<T> |
Flux.replay(int history,
java.time.Duration ttl,
Scheduler timer)
Turn this
Flux into a connectable hot source and cache last emitted signals
for further Subscriber . |
ParallelFlux<T> |
ParallelFlux.runOn(Scheduler scheduler)
Specifies where each 'rail' will observe its incoming values with possible
work-stealing and default prefetch amount.
|
ParallelFlux<T> |
ParallelFlux.runOn(Scheduler scheduler,
int prefetch)
Specifies where each 'rail' will observe its incoming values with possible
work-stealing and a given prefetch amount.
|
Flux<T> |
Flux.skip(java.time.Duration timespan,
Scheduler timer)
|
Mono<T> |
Mono.subscribeOn(Scheduler scheduler)
设置订阅者线程池
Run subscribe, onSubscribe and request on a specified
Scheduler 's Scheduler.Worker . |
Flux<T> |
Flux.subscribeOn(Scheduler scheduler)
Run subscribe, onSubscribe and request on a specified
Scheduler 's Scheduler.Worker . |
Flux<T> |
Flux.subscribeOn(Scheduler scheduler,
boolean requestOnSeparateThread)
Run subscribe and onSubscribe on a specified
Scheduler 's Scheduler.Worker . |
Mono<T> |
Mono.take(java.time.Duration duration,
Scheduler timer)
Give this Mono a chance to resolve within a specified time frame but complete if it
doesn't.
|
Flux<T> |
Flux.take(java.time.Duration timespan,
Scheduler timer)
|
Mono<Timed<T>> |
Mono.timed(Scheduler clock)
Times this
Mono Subscriber.onNext(Object) event, encapsulated into a Timed object
that lets downstream consumer look at various time information gathered with nanosecond
resolution using the provided Scheduler as a clock:
Timed.elapsed() : the time in nanoseconds since subscription, as a Duration . |
Flux<Timed<T>> |
Flux.timed(Scheduler clock)
Times
Subscriber.onNext(Object) events, encapsulated into a Timed object
that lets downstream consumer look at various time information gathered with nanosecond
resolution using the provided Scheduler as a clock:
Timed.elapsed() : the time in nanoseconds since last event, as a Duration . |
Mono<T> |
Mono.timeout(java.time.Duration timeout,
Mono<? extends T> fallback,
Scheduler timer)
超时设置。
|
Flux<T> |
Flux.timeout(java.time.Duration timeout,
org.reactivestreams.Publisher<? extends T> fallback,
Scheduler timer)
|
Mono<T> |
Mono.timeout(java.time.Duration timeout,
Scheduler timer)
设置超时时间和指定检测超时的线程池
Signal a
TimeoutException error in case an item doesn't arrive before the given period,
as measured on the provided Scheduler . |
Flux<T> |
Flux.timeout(java.time.Duration timeout,
Scheduler timer)
Propagate a
TimeoutException as soon as no item is emitted within the
given Duration from the previous emission (or the subscription for the first
item), as measured by the specified Scheduler . |
Mono<Tuple2<java.lang.Long,T>> |
Mono.timestamp(Scheduler scheduler)
|
Flux<Tuple2<java.lang.Long,T>> |
Flux.timestamp(Scheduler scheduler)
|
Flux<Flux<T>> |
Flux.window(java.time.Duration windowingTimespan,
java.time.Duration openWindowEvery,
Scheduler timer)
|
Flux<Flux<T>> |
Flux.window(java.time.Duration windowingTimespan,
Scheduler timer)
|
Flux<Flux<T>> |
Flux.windowTimeout(int maxSize,
java.time.Duration maxTime,
Scheduler timer)
|
Flux<Flux<T>> |
Flux.windowTimeout(int maxSize,
java.time.Duration maxTime,
Scheduler timer,
boolean fairBackpressure)
|
限定符和类型 | 方法和说明 |
---|---|
static Scheduler |
Schedulers.boundedElastic()
The common boundedElastic instance, a
Scheduler that dynamically creates a bounded number of
ExecutorService-based Workers, reusing them once the Workers have been shut down. |
static Scheduler |
Schedulers.fromExecutor(java.util.concurrent.Executor executor)
Create a
Scheduler which uses a backing Executor to schedule
Runnables for async operators. |
static Scheduler |
Schedulers.fromExecutor(java.util.concurrent.Executor executor,
boolean trampoline)
Create a
Scheduler which uses a backing Executor to schedule
Runnables for async operators. |
static Scheduler |
Schedulers.fromExecutorService(java.util.concurrent.ExecutorService executorService)
Create a
Scheduler which uses a backing ExecutorService to schedule
Runnables for async operators. |
static Scheduler |
Schedulers.fromExecutorService(java.util.concurrent.ExecutorService executorService,
java.lang.String executorName)
Create a
Scheduler which uses a backing ExecutorService to schedule
Runnables for async operators. |
static Scheduler |
Schedulers.immediate()
Executes tasks immediately instead of scheduling them.
|
static Scheduler |
Schedulers.newBoundedElastic(int threadCap,
int queuedTaskCap,
java.lang.String name)
Scheduler that dynamically creates a bounded number of ExecutorService-based
Workers, reusing them once the Workers have been shut down. |
static Scheduler |
Schedulers.newBoundedElastic(int threadCap,
int queuedTaskCap,
java.lang.String name,
int ttlSeconds)
Scheduler that dynamically creates a bounded number of ExecutorService-based
Workers, reusing them once the Workers have been shut down. |
static Scheduler |
Schedulers.newBoundedElastic(int threadCap,
int queuedTaskCap,
java.lang.String name,
int ttlSeconds,
boolean daemon)
Scheduler that dynamically creates a bounded number of ExecutorService-based
Workers, reusing them once the Workers have been shut down. |
static Scheduler |
Schedulers.newBoundedElastic(int threadCap,
int queuedTaskCap,
java.util.concurrent.ThreadFactory threadFactory,
int ttlSeconds)
Scheduler that dynamically creates a bounded number of ExecutorService-based
Workers, reusing them once the Workers have been shut down. |
default Scheduler |
Schedulers.Factory.newBoundedElastic(int threadCap,
int queuedTaskCap,
java.util.concurrent.ThreadFactory threadFactory,
int ttlSeconds)
Scheduler that dynamically creates a bounded number of ExecutorService-based
Workers, reusing them once the Workers have been shut down. |
static Scheduler |
Schedulers.newParallel(int parallelism,
java.util.concurrent.ThreadFactory threadFactory)
Scheduler that hosts a fixed pool of single-threaded ExecutorService-based
workers and is suited for parallel work. |
default Scheduler |
Schedulers.Factory.newParallel(int parallelism,
java.util.concurrent.ThreadFactory threadFactory)
Scheduler that hosts a fixed pool of workers and is suited for parallel
work. |
static Scheduler |
Schedulers.newParallel(java.lang.String name)
Scheduler that hosts a fixed pool of single-threaded ExecutorService-based
workers and is suited for parallel work. |
static Scheduler |
Schedulers.newParallel(java.lang.String name,
int parallelism)
Scheduler that hosts a fixed pool of single-threaded ExecutorService-based
workers and is suited for parallel work. |
static Scheduler |
Schedulers.newParallel(java.lang.String name,
int parallelism,
boolean daemon)
Scheduler that hosts a fixed pool of single-threaded ExecutorService-based
workers and is suited for parallel work. |
static Scheduler |
Schedulers.newSingle(java.lang.String name)
Scheduler that hosts a single-threaded ExecutorService-based worker. |
static Scheduler |
Schedulers.newSingle(java.lang.String name,
boolean daemon)
Scheduler that hosts a single-threaded ExecutorService-based worker. |
static Scheduler |
Schedulers.newSingle(java.util.concurrent.ThreadFactory threadFactory)
Scheduler that hosts a single-threaded ExecutorService-based worker. |
default Scheduler |
Schedulers.Factory.newSingle(java.util.concurrent.ThreadFactory threadFactory)
Scheduler that hosts a single worker and is suited for non-blocking
work. |
static Scheduler |
Schedulers.parallel()
The common parallel instance, a
Scheduler that hosts a fixed pool of single-threaded
ExecutorService-based workers and is suited for parallel work. |
static Scheduler |
Schedulers.single()
普通单线程
The common single instance, a
Scheduler that hosts a single-threaded ExecutorService-based
worker. |
static Scheduler |
Schedulers.single(Scheduler original)
Wraps a single
Scheduler.Worker from some other
Scheduler and provides Scheduler.Worker
services on top of it. |
限定符和类型 | 方法和说明 |
---|---|
static java.util.function.BiFunction<Scheduler,java.util.concurrent.ScheduledExecutorService,java.util.concurrent.ScheduledExecutorService> |
Schedulers.removeExecutorServiceDecorator(java.lang.String key)
Remove an existing
ScheduledExecutorService decorator if it has been set up
via Schedulers.addExecutorServiceDecorator(String, BiFunction) . |
限定符和类型 | 方法和说明 |
---|---|
static java.util.concurrent.ScheduledExecutorService |
Schedulers.decorateExecutorService(Scheduler owner,
java.util.concurrent.ScheduledExecutorService original)
This method is aimed at
Scheduler implementors, enabling custom implementations
that are backed by a ScheduledExecutorService to also have said executors
decorated (ie. for instrumentation purposes). |
static Scheduler |
Schedulers.single(Scheduler original)
Wraps a single
Scheduler.Worker from some other
Scheduler and provides Scheduler.Worker
services on top of it. |
限定符和类型 | 方法和说明 |
---|---|
static boolean |
Schedulers.addExecutorServiceDecorator(java.lang.String key,
java.util.function.BiFunction<Scheduler,java.util.concurrent.ScheduledExecutorService,java.util.concurrent.ScheduledExecutorService> decorator)
Set up an additional
ScheduledExecutorService decorator for a given key
only if that key is not already present. |
static void |
Schedulers.setExecutorServiceDecorator(java.lang.String key,
java.util.function.BiFunction<Scheduler,java.util.concurrent.ScheduledExecutorService,java.util.concurrent.ScheduledExecutorService> decorator)
Set up an additional
ScheduledExecutorService decorator for a given key,
even if that key is already present. |
限定符和类型 | 类和说明 |
---|---|
class |
VirtualTimeScheduler
A
Scheduler that uses a virtual clock, allowing to manipulate time
(eg. in tests). |
限定符和类型 | 方法和说明 |
---|---|
static void |
RaceTestUtils.race(int timeoutSeconds,
Scheduler s,
java.lang.Runnable... rs)
Synchronizes the execution of several
Runnable s as much as possible
to test race conditions. |
static void |
RaceTestUtils.race(java.lang.Runnable r1,
java.lang.Runnable r2,
Scheduler s)
已过时。
Use
RaceTestUtils.race(Scheduler, Runnable...) . To be removed in 3.6.0, at the earliest. |
static void |
RaceTestUtils.race(Scheduler s,
java.lang.Runnable... rs)
Synchronizes the execution of several
Runnable s as much as possible
to test race conditions. |
限定符和类型 | 字段和说明 |
---|---|
java.util.function.Supplier<Scheduler> |
RetryBackoffSpec.backoffSchedulerSupplier
The configured
Supplier of Scheduler on which to execute backoffs. |
限定符和类型 | 方法和说明 |
---|---|
RetryBackoffSpec |
RetryBackoffSpec.scheduler(Scheduler backoffScheduler)
Set a
Scheduler on which to execute the delays computed by the exponential backoff
strategy. |