本文整理汇总了Java中reactor.core.publisher.Operators.validate方法的典型用法代码示例。如果您正苦于以下问题:Java Operators.validate方法的具体用法?Java Operators.validate怎么用?Java Operators.validate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类reactor.core.publisher.Operators
的用法示例。
在下文中一共展示了Operators.validate方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: request
import reactor.core.publisher.Operators; //导入方法依赖的package包/类
@Override
public void request(long n) {
if (Operators.validate(n)) {
for (; ; ) {
int s = state;
if (s == SDS_HAS_REQUEST_NO_VALUE || s == SDS_HAS_REQUEST_HAS_VALUE) {
return;
}
if (s == SDS_NO_REQUEST_HAS_VALUE) {
if (STATE.compareAndSet(this, SDS_NO_REQUEST_HAS_VALUE, SDS_HAS_REQUEST_HAS_VALUE)) {
Subscriber<? super O> a = subscriber;
a.onNext(value);
a.onComplete();
}
return;
}
if (STATE.compareAndSet(this, SDS_NO_REQUEST_NO_VALUE, SDS_HAS_REQUEST_NO_VALUE)) {
return;
}
}
}
}
示例2: onSubscribe
import reactor.core.publisher.Operators; //导入方法依赖的package包/类
@Override
public void onSubscribe(Subscription s) {
if (Operators.validate(this.s, s)) {
this.s = s;
this.start = System.nanoTime();
actual.onSubscribe(this);
}
}
示例3: request
import reactor.core.publisher.Operators; //导入方法依赖的package包/类
@Override
public void request(long n) {
if (Operators.validate(n)) {
if (establishedFusionMode != Fuseable.SYNC) {
normalRequest(n);
}
}
}
示例4: request
import reactor.core.publisher.Operators; //导入方法依赖的package包/类
@Override
public final void request(long n) {
if (Operators.validate(n)) {
if (unbounded) {
return;
}
if (wip == 0 && WIP.compareAndSet(this, 0, 1)) {
long r = requested;
if (r != Long.MAX_VALUE) {
r = Operators.addCap(r, n);
requested = r;
if (r == Long.MAX_VALUE) {
unbounded = true;
}
}
Subscription a = actual;
if (WIP.decrementAndGet(this) != 0) {
drainLoop();
}
if (a != null) {
a.request(n);
}
return;
}
Operators.addCap(MISSED_REQUESTED, this, n);
drain();
}
}
示例5: request
import reactor.core.publisher.Operators; //导入方法依赖的package包/类
@Override
public void request(long n) {
if (Operators.validate(n)) {
if (eventLoop.inEventLoop()) {
this.receiverDemand = Operators.addCap(receiverDemand, n);
drainReceiver();
}
else {
eventLoop.execute(() -> {
this.receiverDemand = Operators.addCap(receiverDemand, n);
drainReceiver();
});
}
}
}
示例6: request
import reactor.core.publisher.Operators; //导入方法依赖的package包/类
@Override
public void request(long n) {
if (Operators.validate(n)) {
Operators.addCap(REQUESTED, this, n);
parent.wasRequested = true;
}
}
示例7: request
import reactor.core.publisher.Operators; //导入方法依赖的package包/类
@Override
public void request(long n) {
if (Operators.validate(n)) {
if (establishedFusionMode != Fuseable.SYNC) {
normalRequest(n);
}
}
}
示例8: request
import reactor.core.publisher.Operators; //导入方法依赖的package包/类
@Override
public void request(long n) {
if (Operators.validate(n)) {
if (establishedFusionMode != Fuseable.SYNC) {
normalRequest(n);
}
}
}