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

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

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

Operators.onDiscardQueueWithClear介绍

[英]Invoke a (local or global) hook that processes elements that get discarded en masse after having been enqueued, due to cancellation or error. This method also empties the Queue (either by repeated Queue#poll() calls if a hook is defined, or by Queue#clear() as a shortcut if no hook is defined).
[中]调用一个(本地或全局)钩子,该钩子处理由于取消或错误而进入队列后被整体丢弃的元素。此方法还清空队列(如果定义了钩子,则通过重复的Queue#poll()调用,如果未定义钩子,则通过Queue#clear()作为快捷方式)。

代码示例

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

@Override
public void clear() {
  Operators.onDiscardQueueWithClear(queue, ctx, null);
}

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

@Override
public void clear() {
  Operators.onDiscardQueueWithClear(queue, ctx, null);
}

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

private void discardQueue(Queue<SourceAndArray> q) {
  Operators.onDiscardQueueWithClear(q, this.ctx, SourceAndArray::toStream);
}

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

@Override
public void clear() {
  current = null;
  Operators.onDiscardQueueWithClear(queue, actual.currentContext(), null);
}

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

@Override
void onCancel() {
  if (WIP.getAndIncrement(this) == 0) {
    Operators.onDiscardQueueWithClear(queue, ctx, null);
  }
}

代码示例来源: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 clear() {
  Operators.onDiscardQueueWithClear(queue, actual.currentContext(), null);
}

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

@Override
public void clear() {
  Operators.onDiscardQueueWithClear(queue, actual.currentContext(), null);
}

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

@Override
public void cancel() {
  if (!cancelled) {
    cancelled = true;
    s.cancel();
    if (!enabledFusion) {
      if (WIP.getAndIncrement(this) == 0) {
        Operators.onDiscardQueueWithClear(queue, ctx, null);
      }
    }
  }
}

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

@Override
public void cancel() {
  if (!cancelled) {
    cancelled = true;
    inner.cancel();
    s.cancel();
    Operators.onDiscardQueueWithClear(queue, this.ctx, null);
  }
}

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

@Override
  public void cancel() {
    s.cancel();
    Operators.onDiscardQueueWithClear(this, actual.currentContext(), null);
  }
}

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

@Override
public void cancel() {
  if (!cancelled) {
    cancelled = true;
    inner.cancel();
    s.cancel();
    Operators.onDiscardQueueWithClear(queue, this.ctx, null);
  }
}

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

@Override
public void cancel() {
  if (!cancelled) {
    cancelled = true;
    Operators.terminate(S, this);
    Operators.terminate(OTHER, this);
    Operators.onDiscardQueueWithClear(queue, ctx, SampleTimeoutOther::toStream);
  }
}

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

@Override
public void onError(Throwable t) {
  actual.onError(t);
  Operators.onDiscardQueueWithClear(this, actual.currentContext(), null);
}

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

@Override
public void onComplete() {
  actual.onComplete();
  Operators.onDiscardQueueWithClear(this, actual.currentContext(), null);
}

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

@Override
public void cancel() {
  if (!cancelled) {
    cancelled = true;
    if (WIP.getAndIncrement(this) == 0) {
      Operators.onDiscardQueueWithClear(scalarQueue, ctx, null);
      scalarQueue = null;
      s.cancel();
      unsubscribe();
    }
  }
}

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

@Override
public void cancel() {
  if (!cancelled) {
    cancelled = true;
    s.cancel();
    if (WIP.getAndIncrement(this) == 0) {
      Operators.onDiscardQueueWithClear(queue, actual.currentContext(), null);
    }
  }
}

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

@Override
public void cancel() {
  if (cancelled) {
    return;
  }
  cancelled = true;
  s.cancel();
  worker.dispose();
  if (WIP.getAndIncrement(this) == 0) {
    Operators.onDiscardQueueWithClear(queue, actual.currentContext(), null);
  }
}

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

@Override
public void cancel() {
  if (cancelled) {
    return;
  }
  cancelled = true;
  s.cancel();
  worker.dispose();
  if (WIP.getAndIncrement(this) == 0) {
    Operators.onDiscardQueueWithClear(queue, actual.currentContext(), null);
  }
}

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

void trySchedule(
    @Nullable Subscription subscription,
    @Nullable Throwable suppressed,
    @Nullable Object dataSignal) {
  if (WIP.getAndIncrement(this) != 0) {
    return;
  }
  try {
    worker.schedule(this);
  }
  catch (RejectedExecutionException ree) {
    Operators.onDiscardQueueWithClear(queue, actual.currentContext(), null);
    actual.onError(Operators.onRejectedExecution(ree, subscription, suppressed, dataSignal,
        actual.currentContext()));
  }
}

相关文章