本文整理汇总了Java中reactor.core.publisher.Operators.cancelledSubscription方法的典型用法代码示例。如果您正苦于以下问题:Java Operators.cancelledSubscription方法的具体用法?Java Operators.cancelledSubscription怎么用?Java Operators.cancelledSubscription使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类reactor.core.publisher.Operators
的用法示例。
在下文中一共展示了Operators.cancelledSubscription方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setWithoutRequesting
import reactor.core.publisher.Operators; //导入方法依赖的package包/类
/**
* Sets the Subscription once but does not request anything.
* @param s the Subscription to push
* @return true if successful, false if the current subscription is not null
*/
protected final boolean setWithoutRequesting(Subscription s) {
Objects.requireNonNull(s, "s");
for (;;) {
Subscription a = this.s;
if (a == Operators.cancelledSubscription()) {
s.cancel();
return false;
}
if (a != null) {
s.cancel();
Operators.reportSubscriptionSet();
return false;
}
if (S.compareAndSet(this, null, s)) {
return true;
}
}
}
示例2: setWithoutRequesting
import reactor.core.publisher.Operators; //导入方法依赖的package包/类
/**
* Sets the Subscription once but does not request anything.
* @param s the Subscription to push
* @return true if successful, false if the current subscription is not null
*/
protected final boolean setWithoutRequesting(Subscription s) {
Objects.requireNonNull(s, "s");
for (;;) {
Subscription a = this.s;
if (a == Operators.cancelledSubscription()) {
s.cancel();
return false;
}
if (a != null) {
s.cancel();
Operators.reportSubscriptionSet();
return false;
}
if (S.compareAndSet(this, null, s)) {
return true;
}
}
}
示例3: setWithoutRequesting
import reactor.core.publisher.Operators; //导入方法依赖的package包/类
/**
* Sets the Subscription once but does not request anything.
* @param s the Subscription to set
* @return true if successful, false if the current subscription is not null
*/
protected final boolean setWithoutRequesting(Subscription s) {
Objects.requireNonNull(s, "s");
for (;;) {
Subscription a = this.s;
if (a == Operators.cancelledSubscription()) {
s.cancel();
return false;
}
if (a != null) {
s.cancel();
Operators.reportSubscriptionSet();
return false;
}
if (S.compareAndSet(this, null, s)) {
return true;
}
}
}
示例4: cancel
import reactor.core.publisher.Operators; //导入方法依赖的package包/类
@Override
public void cancel() {
Subscription a = s;
if (a != Operators.cancelledSubscription()) {
a = S.getAndSet(this, Operators.cancelledSubscription());
if (a != null && a != Operators.cancelledSubscription()) {
a.cancel();
}
}
}
示例5: set
import reactor.core.publisher.Operators; //导入方法依赖的package包/类
/**
* Atomically sets the single subscription and requests the missed amount from it.
*
* @param s
* @return false if this arbiter is cancelled or there was a subscription already push
*/
protected final boolean set(Subscription s) {
Objects.requireNonNull(s, "s");
Subscription a = this.s;
if (a == Operators.cancelledSubscription()) {
s.cancel();
return false;
}
if (a != null) {
s.cancel();
Operators.reportSubscriptionSet();
return false;
}
if (S.compareAndSet(this, null, s)) {
long r = REQUESTED.getAndSet(this, 0L);
if (r != 0L) {
s.request(r);
}
return true;
}
a = this.s;
if (a != Operators.cancelledSubscription()) {
s.cancel();
return false;
}
Operators.reportSubscriptionSet();
return false;
}
示例6: onComplete
import reactor.core.publisher.Operators; //导入方法依赖的package包/类
@Override
public final void onComplete() {
Subscription s =
OUTBOUND_CLOSE.getAndSet(this, Operators.cancelledSubscription());
if (s == Operators.cancelledSubscription() || isDisposed()) {
return;
}
onOutboundComplete();
}
示例7: onError
import reactor.core.publisher.Operators; //导入方法依赖的package包/类
@Override
public final void onError(Throwable t) {
Subscription s =
OUTBOUND_CLOSE.getAndSet(this, Operators.cancelledSubscription());
if (s == Operators.cancelledSubscription() || isDisposed()) {
if(log.isDebugEnabled()){
log.error("An outbound error could not be processed", t);
}
return;
}
onOutboundError(t);
}
示例8: cancel
import reactor.core.publisher.Operators; //导入方法依赖的package包/类
@Nullable
final Subscription cancel() {
Subscription s =
this.getAndSet(Operators.cancelledSubscription());
if (s != null && s != Operators.cancelledSubscription()) {
s.cancel();
if(establishedFusionMode == Fuseable.ASYNC) {
qs.clear();
}
}
return s;
}
示例9: cancel
import reactor.core.publisher.Operators; //导入方法依赖的package包/类
@Override
public void cancel() {
Subscription a = s;
if (a != Operators.cancelledSubscription()) {
a = S.getAndSet(this, Operators.cancelledSubscription());
if (a != null && a != Operators.cancelledSubscription()) {
a.cancel();
}
}
}
示例10: set
import reactor.core.publisher.Operators; //导入方法依赖的package包/类
/**
* Atomically sets the single subscription and requests the missed amount from it.
*
* @param s
* @return false if this arbiter is cancelled or there was a subscription already push
*/
protected final boolean set(Subscription s) {
Objects.requireNonNull(s, "s");
Subscription a = this.s;
if (a == Operators.cancelledSubscription()) {
s.cancel();
return false;
}
if (a != null) {
s.cancel();
Operators.reportSubscriptionSet();
return false;
}
if (S.compareAndSet(this, null, s)) {
long r = REQUESTED.getAndSet(this, 0L);
if (r != 0L) {
s.request(r);
}
return true;
}
a = this.s;
if (a != Operators.cancelledSubscription()) {
s.cancel();
return false;
}
Operators.reportSubscriptionSet();
return false;
}
示例11: cancel
import reactor.core.publisher.Operators; //导入方法依赖的package包/类
@Override
public void cancel() {
Subscription a = s;
if (a != Operators.cancelledSubscription()) {
a = S.getAndSet(this, Operators.cancelledSubscription());
if (a != null && a != Operators.cancelledSubscription()) {
a.cancel();
}
}
}
示例12: set
import reactor.core.publisher.Operators; //导入方法依赖的package包/类
/**
* Atomically sets the single subscription and requests the missed amount from it.
*
* @param s
* @return false if this arbiter is cancelled or there was a subscription already set
*/
protected final boolean set(Subscription s) {
Objects.requireNonNull(s, "s");
Subscription a = this.s;
if (a == Operators.cancelledSubscription()) {
s.cancel();
return false;
}
if (a != null) {
s.cancel();
Operators.reportSubscriptionSet();
return false;
}
if (S.compareAndSet(this, null, s)) {
long r = REQUESTED.getAndSet(this, 0L);
if (r != 0L) {
s.request(r);
}
return true;
}
a = this.s;
if (a != Operators.cancelledSubscription()) {
s.cancel();
return false;
}
Operators.reportSubscriptionSet();
return false;
}
示例13: isCancelled
import reactor.core.publisher.Operators; //导入方法依赖的package包/类
final boolean isCancelled() {
return s == Operators.cancelledSubscription();
}
示例14: isCancelled
import reactor.core.publisher.Operators; //导入方法依赖的package包/类
boolean isCancelled() {
return get() == Operators.cancelledSubscription();
}
示例15: drainAsyncLoop
import reactor.core.publisher.Operators; //导入方法依赖的package包/类
void drainAsyncLoop(){
T t;
long r = requested;
for( ; ;) {
boolean d = done;
if (d && qs.isEmpty()) {
if(get() == Operators.cancelledSubscription()){
return;
}
if(errors != null){
onExpectation(Signal.complete());
}
this.completeLatch.countDown();
return;
}
if (r == 0L) {
return;
}
long p = 0L;
while (p != r) {
if(get() == Operators.cancelledSubscription()){
return;
}
try {
t = qs.poll();
if (t == null) {
break;
}
p++;
produced++;
unasserted++;
}
catch (Throwable e) {
Exceptions.throwIfFatal(e);
cancel();
onError(Exceptions.unwrap(e));
return;
}
if (currentCollector != null) {
currentCollector.add(t);
}
Signal<T> signal = Signal.next(t);
if (!checkRequestOverflow(signal)) {
onExpectation(signal);
if (d && qs.isEmpty()) {
if(get() == Operators.cancelledSubscription()){
return;
}
if(errors != null){
onExpectation(Signal.complete());
}
this.completeLatch.countDown();
return;
}
}
else {
return;
}
}
if (p != 0) {
r = REQUESTED.addAndGet(this, -p);
}
if(r == 0L || qs.isEmpty()){
break;
}
}
}