reactor.core.publisher.Operators.terminate()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(3.4k)|赞(0)|评价(0)|浏览(174)

本文整理了Java中reactor.core.publisher.Operators.terminate()方法的一些代码示例,展示了Operators.terminate()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Operators.terminate()方法的具体详情如下:
包路径:reactor.core.publisher.Operators
类名称:Operators
方法名:terminate

Operators.terminate介绍

[英]Atomically terminates the subscription if it is not already a #cancelledSubscription(), cancelling the subscription and setting the field to the singleton #cancelledSubscription().
[中]如果订阅尚未为#cancelledSubscription(),则自动终止订阅,取消订阅并将字段设置为singleton#cancelledSubscription()。

代码示例

代码示例来源:origin: reactor/reactor-core

@Override
  public void cancel() {
    Operators.terminate(S, this);
  }
}

代码示例来源:origin: reactor/reactor-core

@Override
public void cancel() {
  if(!done) {
    Operators.terminate(S, this);
  }
}

代码示例来源:origin: reactor/reactor-core

@Override
  public void dispose() {
    Operators.terminate(S, this);
  }
}

代码示例来源:origin: reactor/reactor-core

@Override
public void cancel() {
  Operators.terminate(MAIN, this);
  Operators.terminate(OTHER, this);
}

代码示例来源:origin: reactor/reactor-core

void otherError(Throwable e) {
    Operators.terminate(S, this);
    error(e);
  }
}

代码示例来源:origin: reactor/reactor-core

@Override
public void cancel() {
  Operators.terminate(S, this);
  Operators.onDiscardMultiple(buffer, this.ctx);
}

代码示例来源:origin: reactor/reactor-core

@Override
  @SuppressWarnings("unchecked")
  public void terminate() {
    Operators.terminate(S, this);
    if (WIP.getAndIncrement(this) == 0) {
      if (connected) {
        queue.clear();
      }
    }
  }
}

代码示例来源:origin: reactor/reactor-core

@Override
  public void cancel() {
    if (Operators.terminate(S, this)) {
      worker.dispose();
    }
  }
}

代码示例来源:origin: reactor/reactor-core

@Override
public void cancel() {
  main.cancel();
  Operators.terminate(INNER, this);
}

代码示例来源:origin: reactor/reactor-core

@Override
  public void terminate() {
    Operators.terminate(S, this);
    if (WIP.getAndIncrement(this) == 0) {
      if (connected) {
        value = null;
      }
    }
  }
}

代码示例来源:origin: reactor/reactor-core

@Override
public void run() {
  Operators.terminate(S, this);
  signalConsumer();
}

代码示例来源:origin: reactor/reactor-core

@Override
public void onError(Throwable t) {
  Operators.terminate(OTHER, this);
  error(t);
}

代码示例来源:origin: reactor/reactor-core

@Override
public void cancel() {
  Operators.terminate(S, this);
  Operators.onDiscardQueueWithClear(queue, parent.ctx, null);
}

代码示例来源:origin: reactor/reactor-core

@Override
public void onNext(Object t) {
  if (Operators.terminate(SUBSCRIPTION, this)) {
    parent.innerClose(isLeft, this);
  }
}

代码示例来源:origin: reactor/reactor-core

@Override
public void cancel() {
  super.cancel();
  Operators.terminate(S, this);
  second.cancel();
}

代码示例来源:origin: reactor/reactor-core

@Override
public void cancel() {
  Operators.terminate(S, this);
  Operators.onDiscardMultiple(buffer, this.ctx);
  other.cancel();
}

代码示例来源:origin: reactor/reactor-core

@Override
public void onComplete() {
  Operators.terminate(OTHER, this);
  if (WIP.getAndIncrement(this) == 0) {
    handleTermination();
  }
}

代码示例来源:origin: reactor/reactor-core

@Override
public void onNext(T t) {
  if (done) {
    Operators.onNextDropped(t, parent.currentContext());
    return;
  }
  done = true;
  Operators.terminate(S, this);
  parent.next(t, index);
}

代码示例来源:origin: reactor/reactor-core

void openComplete(BufferWhenOpenSubscriber<OPEN> os) {
  subscribers.remove(os);
  if (subscribers.size() == 0) {
    Operators.terminate(S, this);
    done = true;
    drain();
  }
}

代码示例来源:origin: reactor/reactor-core

@Override
public void onNext(T t) {
  if (!queue.offer(t)) {
    Operators.terminate(S, this);
    onError(Operators.onOperatorError(null,
        Exceptions.failWithOverflow(Exceptions.BACKPRESSURE_ERROR_QUEUE_FULL),
        t, currentContext()));
  }
  else {
    signalConsumer();
  }
}

相关文章