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


Java Operators.cancelledSubscription方法代码示例

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

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

示例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;
    }
  }
}
 
开发者ID:the-james-burton,项目名称:the-turbine,代码行数:25,代码来源:AssertSubscriber.java

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

示例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;
}
 
开发者ID:apptik,项目名称:RHub,代码行数:41,代码来源:AssertSubscriber.java

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

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

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

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

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

示例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();
    }
  }
}
 
开发者ID:the-james-burton,项目名称:the-turbine,代码行数:11,代码来源:AssertSubscriber.java

示例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;
}
 
开发者ID:the-james-burton,项目名称:the-turbine,代码行数:41,代码来源:AssertSubscriber.java

示例13: isCancelled

import reactor.core.publisher.Operators; //导入方法依赖的package包/类
final boolean isCancelled() {
    return s == Operators.cancelledSubscription();
}
 
开发者ID:apptik,项目名称:RHub,代码行数:4,代码来源:AssertSubscriber.java

示例14: isCancelled

import reactor.core.publisher.Operators; //导入方法依赖的package包/类
boolean isCancelled() {
	return get() == Operators.cancelledSubscription();
}
 
开发者ID:reactor,项目名称:reactor-core,代码行数:4,代码来源:DefaultStepVerifierBuilder.java

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


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