本文整理了Java中reactor.core.publisher.Operators.multiplyCap()
方法的一些代码示例,展示了Operators.multiplyCap()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Operators.multiplyCap()
方法的具体详情如下:
包路径:reactor.core.publisher.Operators
类名称:Operators
方法名:multiplyCap
[英]Cap a multiplication to Long.MAX_VALUE
[中]将乘法运算限制为长。最大值
代码示例来源:origin: reactor/reactor-core
@Override
public void request(long n) {
if (Operators.validate(n)) {
if (firstRequest == 0 && FIRST_REQUEST.compareAndSet(this, 0, 1)) {
long u = Operators.multiplyCap(size, n);
long v = Operators.multiplyCap(skip - size, n - 1);
long w = Operators.addCap(u, v);
s.request(w);
}
else {
long u = Operators.multiplyCap(skip, n);
s.request(u);
}
}
}
代码示例来源:origin: reactor/reactor-core
@Override
public void request(long n) {
if (Operators.validate(n)) {
long u = Operators.multiplyCap(size, n);
s.request(u);
}
}
代码示例来源:origin: reactor/reactor-core
@Override
public void request(long n) {
if (Operators.validate(n)) {
s.request(Operators.multiplyCap(n, size));
}
}
代码示例来源:origin: reactor/reactor-core
@Override
public void request(long n) {
if (!Operators.validate(n)) {
return;
}
if (wip == 0 && WIP.compareAndSet(this, 0, 1)) {
// n full buffers
long u = Operators.multiplyCap(n, size);
// + (n - 1) gaps
long v = Operators.multiplyCap(skip - size, n - 1);
s.request(Operators.addCap(u, v));
}
else {
// n full buffer + gap
s.request(Operators.multiplyCap(skip, n));
}
}
代码示例来源:origin: reactor/reactor-core
@Override
public void request(long n) {
if (Operators.validate(n)) {
Operators.addCap(REQUESTED, this, n);
if (firstRequest == 0 && FIRST_REQUEST.compareAndSet(this, 0, 1)) {
long u = Operators.multiplyCap(skip, n - 1);
long v = Operators.addCap(size, u);
s.request(v);
}
else {
long u = Operators.multiplyCap(skip, n);
s.request(u);
}
drain();
}
}
代码示例来源:origin: reactor/reactor-core
@Override
public void request(long n) {
if (!Operators.validate(n)) {
return;
}
if (DrainUtils.postCompleteRequest(n,
actual,
this,
REQUESTED,
this,
this)) {
return;
}
if (once == 0 && ONCE.compareAndSet(this, 0, 1)) {
// (n - 1) skips
long u = Operators.multiplyCap(skip, n - 1);
// + 1 full buffer
long r = Operators.addCap(size, u);
s.request(r);
}
else {
// n skips
long r = Operators.multiplyCap(skip, n);
s.request(r);
}
}
代码示例来源:origin: reactor/reactor-core
@Override
public void request(long n) {
if (Operators.validate(n)) {
Operators.addCap(REQUESTED, this, n);
if (terminated != NOT_TERMINATED) {
return;
}
if (batchSize == Integer.MAX_VALUE || n == Long.MAX_VALUE) {
requestMore(Long.MAX_VALUE);
}
else {
requestMore(Operators.multiplyCap(n, batchSize));
}
}
}
代码示例来源:origin: io.projectreactor/reactor-core
@Override
public void request(long n) {
if (Operators.validate(n)) {
if (firstRequest == 0 && FIRST_REQUEST.compareAndSet(this, 0, 1)) {
long u = Operators.multiplyCap(size, n);
long v = Operators.multiplyCap(skip - size, n - 1);
long w = Operators.addCap(u, v);
s.request(w);
}
else {
long u = Operators.multiplyCap(skip, n);
s.request(u);
}
}
}
代码示例来源:origin: io.projectreactor/reactor-core
@Override
public void request(long n) {
if (Operators.validate(n)) {
long u = Operators.multiplyCap(size, n);
s.request(u);
}
}
代码示例来源:origin: io.projectreactor/reactor-core
@Override
public void request(long n) {
if (Operators.validate(n)) {
s.request(Operators.multiplyCap(n, size));
}
}
代码示例来源:origin: io.projectreactor/reactor-core
@Override
public void request(long n) {
if (!Operators.validate(n)) {
return;
}
if (wip == 0 && WIP.compareAndSet(this, 0, 1)) {
// n full buffers
long u = Operators.multiplyCap(n, size);
// + (n - 1) gaps
long v = Operators.multiplyCap(skip - size, n - 1);
s.request(Operators.addCap(u, v));
}
else {
// n full buffer + gap
s.request(Operators.multiplyCap(skip, n));
}
}
代码示例来源:origin: io.projectreactor/reactor-core
@Override
public void request(long n) {
if (Operators.validate(n)) {
Operators.addCap(REQUESTED, this, n);
if (firstRequest == 0 && FIRST_REQUEST.compareAndSet(this, 0, 1)) {
long u = Operators.multiplyCap(skip, n - 1);
long v = Operators.addCap(size, u);
s.request(v);
}
else {
long u = Operators.multiplyCap(skip, n);
s.request(u);
}
drain();
}
}
代码示例来源:origin: io.projectreactor/reactor-core
@Override
public void request(long n) {
if (!Operators.validate(n)) {
return;
}
if (DrainUtils.postCompleteRequest(n,
actual,
this,
REQUESTED,
this,
this)) {
return;
}
if (once == 0 && ONCE.compareAndSet(this, 0, 1)) {
// (n - 1) skips
long u = Operators.multiplyCap(skip, n - 1);
// + 1 full buffer
long r = Operators.addCap(size, u);
s.request(r);
}
else {
// n skips
long r = Operators.multiplyCap(skip, n);
s.request(r);
}
}
代码示例来源:origin: io.projectreactor/reactor-core
@Override
public void request(long n) {
if (Operators.validate(n)) {
Operators.addCap(REQUESTED, this, n);
if (terminated != NOT_TERMINATED) {
return;
}
if (batchSize == Integer.MAX_VALUE || n == Long.MAX_VALUE) {
requestMore(Long.MAX_VALUE);
}
else {
requestMore(Operators.multiplyCap(n, batchSize));
}
}
}
内容来源于网络,如有侵权,请联系作者删除!