Esempio 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();
 }
Esempio n. 3
0
 @Override
 protected void doError(Throwable throwable) {
   if (TERMINATED.compareAndSet(this, 0, 1)) {
     tryDrain();
     super.doError(throwable);
   }
 }
Esempio 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);
 }
Esempio n. 5
0
 @Override
 protected void doCancel() {
   if ((options & CANCEL) == CANCEL && log.isInfoEnabled()) {
     log.info("↥ " + concatId() + "cancel()");
   }
   super.doCancel();
 }
Esempio 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);
 }
Esempio n. 7
0
 @Override
 protected void doComplete() {
   if ((options & ON_COMPLETE) == ON_COMPLETE && log.isInfoEnabled()) {
     log.info("↧ " + concatId() + "onComplete()");
   }
   super.doComplete();
 }
Esempio 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);
 }
Esempio 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);
 }
Esempio n. 10
0
 @Override
 protected void doComplete() {
   if (TERMINATED.compareAndSet(this, 0, 1)) {
     if (tryDrain()) {
       super.doComplete();
     }
   }
 }
Esempio n. 11
0
 private void requestMissing() {
   if (pendingDemand != Long.MAX_VALUE) {
     super.doRequest(1L);
   }
 }