T - 队列中元素的类型public interface ClusterQueue<T>
| 限定符和类型 | 接口和说明 |
|---|---|
static class |
ClusterQueue.Mod |
| 限定符和类型 | 方法和说明 |
|---|---|
reactor.core.publisher.Mono<Boolean> |
add(org.reactivestreams.Publisher<T> publisher)
向队列中添加数据
|
reactor.core.publisher.Mono<Boolean> |
addBatch(org.reactivestreams.Publisher<? extends Collection<T>> publisher)
向队列中批量添加数据
|
reactor.core.publisher.Mono<T> |
poll()
消费队列中的数据,队列为空时返回
Mono.empty() |
void |
setLocalConsumerPercent(float percent)
设置本地消费占比,如果当前队列在同一个进程中存在消费者,则根据此因子进行本地消费.而不发送到集群.
|
void |
setPollMod(ClusterQueue.Mod mod) |
reactor.core.publisher.Mono<Integer> |
size()
获取队列中消息数量
|
void |
stop()
停止队列,停止后不再消费队列数据.
|
reactor.core.publisher.Flux<T> |
subscribe()
订阅队列中的数据
|
reactor.core.publisher.Mono<Boolean> add(org.reactivestreams.Publisher<T> publisher)
publisher - 数据流reactor.core.publisher.Mono<Boolean> addBatch(org.reactivestreams.Publisher<? extends Collection<T>> publisher)
publisher - 数据流void setLocalConsumerPercent(float percent)
percent - 0-10之间的值void stop()
reactor.core.publisher.Mono<Integer> size()
void setPollMod(ClusterQueue.Mod mod)
Copyright © 2019–2022. All rights reserved.