本文整理了Java中reactor.core.publisher.Operators.setOnce()
方法的一些代码示例,展示了Operators.setOnce()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Operators.setOnce()
方法的具体详情如下:
包路径:reactor.core.publisher.Operators
类名称:Operators
方法名:setOnce
[英]Sets the given subscription once and returns true if successful, false if the field has a subscription already or has been cancelled.
If the field already has a subscription, it is cancelled and the duplicate subscription is reported (see #reportSubscriptionSet()).
[中]设置给定的订阅一次,如果成功,则返回true;如果该字段已订阅或已取消订阅,则返回false。
如果该字段已经有订阅,则会取消订阅并报告重复订阅(请参阅#reportSubscriptionSet()。
代码示例来源:origin: reactor/reactor-core
@Override
public void onSubscribe(Subscription s) {
if (Operators.setOnce(SUBSCRIPTION, this, s)) {
subscription.request(Long.MAX_VALUE);
}
}
代码示例来源:origin: reactor/reactor-core
@Override
public void onSubscribe(Subscription s) {
if (Operators.setOnce(S, this, s)) {
s.request(Long.MAX_VALUE);
}
}
代码示例来源:origin: reactor/reactor-core
@Override
public void onSubscribe(Subscription s) {
if (Operators.setOnce(S, this, s)) {
s.request(Long.MAX_VALUE);
}
}
代码示例来源:origin: reactor/reactor-core
@Override
public void onSubscribe(Subscription s) {
if (Operators.setOnce(S, this, s)) {
s.request(prefetch);
}
}
代码示例来源:origin: reactor/reactor-core
@Override
public void onSubscribe(Subscription s) {
if (Operators.setOnce(SUBSCRIPTION, this, s)) {
subscription.request(Long.MAX_VALUE);
}
}
代码示例来源:origin: reactor/reactor-core
@Override
public void onSubscribe(Subscription s) {
if (Operators.setOnce(S, this, s)) {
s.request(Long.MAX_VALUE);
}
}
代码示例来源:origin: reactor/reactor-core
@Override
public void onSubscribe(Subscription s) {
if (Operators.setOnce(S, this, s)) {
s.request(Long.MAX_VALUE);
}
}
代码示例来源:origin: reactor/reactor-core
@Override
public void onSubscribe(Subscription s) {
if (Operators.setOnce(S, this, s)) {
s.request(Long.MAX_VALUE);
}
}
代码示例来源:origin: reactor/reactor-core
@Override
public void onSubscribe(Subscription s) {
if (Operators.setOnce(SUB, this, s)) {
s.request(Long.MAX_VALUE);
}
}
代码示例来源:origin: reactor/reactor-core
@Override
public void onSubscribe(Subscription s) {
if (Operators.setOnce(S, this, s)) {
s.request(Long.MAX_VALUE);
}
}
代码示例来源:origin: reactor/reactor-core
@Override
public void onSubscribe(Subscription s) {
if (Operators.setOnce(SUBSCRIPTION, this, s)) {
subscription.request(Long.MAX_VALUE);
}
}
代码示例来源:origin: reactor/reactor-core
@Override
public void onSubscribe(Subscription s) {
if (Operators.setOnce(S, this, s)) {
s.request(Operators.unboundedOrPrefetch(batchSize));
}
}
代码示例来源:origin: reactor/reactor-core
@Override
public void onSubscribe(Subscription s) {
if (Operators.setOnce(S, this, s)) {
s.request(Long.MAX_VALUE);
}
else {
s.cancel();
}
}
代码示例来源:origin: reactor/reactor-core
@Override
public void onSubscribe(Subscription s) {
if (Operators.setOnce(S, this, s)) {
s.request(Operators.unboundedOrPrefetch(prefetch));
}
}
代码示例来源:origin: reactor/reactor-core
@Override
public void onSubscribe(Subscription s) {
if (Operators.setOnce(S, this, s)) {
s.request(Long.MAX_VALUE);
} else {
s.cancel();
}
}
代码示例来源:origin: reactor/reactor-core
void onSubscribeInner(Subscription s) {
if (Operators.setOnce(INNER, this, s)) {
long r = REQUESTED.getAndSet(this, 0L);
if (r != 0) {
s.request(r);
}
}
}
代码示例来源:origin: reactor/reactor-core
@Override
public void onSubscribe(Subscription s) {
if (Operators.setOnce(S, this, s)) {
s.request(Long.MAX_VALUE);
}
else {
s.cancel();
}
}
代码示例来源:origin: reactor/reactor-core
@Override
public void onSubscribe(Subscription s) {
if(buffer.isDone()){
s.cancel();
}
else if (Operators.setOnce(S, this, s)) {
s.request(Long.MAX_VALUE);
}
}
代码示例来源:origin: reactor/reactor-core
@Override
public void onSubscribe(Subscription s) {
if (Operators.setOnce(S, this, s)) {
long r = REQUESTED.getAndSet(this, 0L);
if (r != 0L) {
trySchedule(r, s);
}
}
}
代码示例来源:origin: reactor/reactor-core
@Override
public final void onSubscribe(Subscription s) {
if (Operators.setOnce(S, this, s)) {
try {
hookOnSubscribe(s);
}
catch (Throwable throwable) {
onError(Operators.onOperatorError(s, throwable, currentContext()));
}
}
}
内容来源于网络,如有侵权,请联系作者删除!