Exemplo n.º 1
0
 @Override
 protected void doRequest(long n) {
   if (BackpressureUtils.getAndAdd(PENDING_UPDATER, this, n) == 0) {
     super.doRequest(n);
     if (!tryDrain()) {
       requestMissing();
     }
   } else if (terminated == 1) {
     if (tryDrain() && TERMINATED.compareAndSet(this, 1, 2)) {
       super.doComplete();
     }
   }
 }
 @Override
 protected void doCancel() {
   if (cancelConsumer != null) {
     cancelConsumer.accept(null);
   }
   super.doCancel();
 }
Exemplo n.º 3
0
 @Override
 protected void doError(Throwable throwable) {
   if (TERMINATED.compareAndSet(this, 0, 1)) {
     tryDrain();
     super.doError(throwable);
   }
 }
Exemplo n.º 4
0
 @Override
 protected void doOnSubscribe(Subscription subscription) {
   if ((options & ON_SUBSCRIBE) == ON_SUBSCRIBE && log.isInfoEnabled()) {
     log.info("⇩ " + concatId() + "onSubscribe({})", this.subscription);
   }
   super.doOnSubscribe(subscription);
 }
Exemplo n.º 5
0
 @Override
 protected void doCancel() {
   if ((options & CANCEL) == CANCEL && log.isInfoEnabled()) {
     log.info("↥ " + concatId() + "cancel()");
   }
   super.doCancel();
 }
Exemplo n.º 6
0
 @Override
 protected void doRequest(long n) {
   if ((options & REQUEST) == REQUEST && log.isInfoEnabled()) {
     log.info("⇡ " + concatId() + "request({})", Long.MAX_VALUE == n ? "unbounded" : n);
   }
   super.doRequest(n);
 }
Exemplo n.º 7
0
 @Override
 protected void doComplete() {
   if ((options & ON_COMPLETE) == ON_COMPLETE && log.isInfoEnabled()) {
     log.info("↧ " + concatId() + "onComplete()");
   }
   super.doComplete();
 }
Exemplo n.º 8
0
 @Override
 protected void doError(Throwable throwable) {
   if ((options & ON_ERROR) == ON_ERROR && log.isErrorEnabled()) {
     log.error("↯ " + concatId() + "onError({})", throwable);
   }
   super.doError(throwable);
 }
Exemplo n.º 9
0
 @Override
 protected void doNext(IN in) {
   if ((options & ON_NEXT) == ON_NEXT && log.isInfoEnabled()) {
     log.info("↓ " + concatId() + "onNext({})", in);
   }
   super.doNext(in);
 }
Exemplo n.º 10
0
 @Override
 protected void doComplete() {
   if (TERMINATED.compareAndSet(this, 0, 1)) {
     if (tryDrain()) {
       super.doComplete();
     }
   }
 }
Exemplo n.º 11
0
 private void requestMissing() {
   if (pendingDemand != Long.MAX_VALUE) {
     super.doRequest(1L);
   }
 }