Example #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();
 }
Example #3
0
 @Override
 protected void doError(Throwable throwable) {
   if (TERMINATED.compareAndSet(this, 0, 1)) {
     tryDrain();
     super.doError(throwable);
   }
 }
Example #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);
 }
Example #5
0
 @Override
 protected void doCancel() {
   if ((options & CANCEL) == CANCEL && log.isInfoEnabled()) {
     log.info("↥ " + concatId() + "cancel()");
   }
   super.doCancel();
 }
Example #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);
 }
Example #7
0
 @Override
 protected void doComplete() {
   if ((options & ON_COMPLETE) == ON_COMPLETE && log.isInfoEnabled()) {
     log.info("↧ " + concatId() + "onComplete()");
   }
   super.doComplete();
 }
Example #8
0
 @Override
 protected void doError(Throwable throwable) {
   if ((options & ON_ERROR) == ON_ERROR && log.isErrorEnabled()) {
     log.error("↯ " + concatId() + "onError({})", throwable);
   }
   super.doError(throwable);
 }
Example #9
0
 @Override
 protected void doNext(IN in) {
   if ((options & ON_NEXT) == ON_NEXT && log.isInfoEnabled()) {
     log.info("↓ " + concatId() + "onNext({})", in);
   }
   super.doNext(in);
 }
Example #10
0
 @Override
 protected void doComplete() {
   if (TERMINATED.compareAndSet(this, 0, 1)) {
     if (tryDrain()) {
       super.doComplete();
     }
   }
 }
Example #11
0
 private void requestMissing() {
   if (pendingDemand != Long.MAX_VALUE) {
     super.doRequest(1L);
   }
 }