当前位置: 首页>>代码示例>>Java>>正文


Java Operators.validate方法代码示例

本文整理汇总了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;
            }
        }
    }
}
 
开发者ID:akarnokd,项目名称:akarnokd-misc,代码行数:23,代码来源:DeferredScalarSubscriber.java

示例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);
  }
}
 
开发者ID:netifi,项目名称:proteus-java,代码行数:10,代码来源:ProteusMetricsSubscriber.java

示例3: request

import reactor.core.publisher.Operators; //导入方法依赖的package包/类
@Override
public void request(long n) {
    if (Operators.validate(n)) {
        if (establishedFusionMode != Fuseable.SYNC) {
            normalRequest(n);
        }
    }
}
 
开发者ID:apptik,项目名称:RHub,代码行数:9,代码来源:AssertSubscriber.java

示例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();
	}
}
 
开发者ID:reactor,项目名称:reactor-netty,代码行数:35,代码来源:ChannelOperationsHandler.java

示例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();
			});
		}
	}
}
 
开发者ID:reactor,项目名称:reactor-netty,代码行数:16,代码来源:FluxReceive.java

示例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;
	}
}
 
开发者ID:reactor,项目名称:reactor-core,代码行数:8,代码来源:DefaultTestPublisher.java

示例7: request

import reactor.core.publisher.Operators; //导入方法依赖的package包/类
@Override
public void request(long n) {
	if (Operators.validate(n)) {
		if (establishedFusionMode != Fuseable.SYNC) {
			normalRequest(n);
		}
	}
}
 
开发者ID:reactor,项目名称:reactor-core,代码行数:9,代码来源:AssertSubscriber.java

示例8: request

import reactor.core.publisher.Operators; //导入方法依赖的package包/类
@Override
public void request(long n) {
  if (Operators.validate(n)) {
    if (establishedFusionMode != Fuseable.SYNC) {
      normalRequest(n);
    }
  }
}
 
开发者ID:the-james-burton,项目名称:the-turbine,代码行数:9,代码来源:AssertSubscriber.java


注:本文中的reactor.core.publisher.Operators.validate方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。