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

x33g5p2x  于2022-01-24 转载在 其他  
字(2.2k)|赞(0)|评价(0)|浏览(204)

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

Mono.ignoreElements介绍

[英]Create a new Mono that ignores elements from the source (dropping them), but completes when the source completes.
[中]创建一个新的Mono,忽略源中的元素(删除它们),但在源完成时完成。

代码示例

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

static <T> Mono<Void> empty(Publisher<T> source) {
  @SuppressWarnings("unchecked")
  Mono<Void> then = (Mono<Void>)ignoreElements(source);
  return then;
}

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

/**
 * Returns a new instance which has the additional source to be merged together with
 * the current array of sources.
 * <p>
 * This operation doesn't change the current FluxMerge instance.
 *
 * @param source the new source to merge with the others
 * @return the new FluxConcatArray instance
 */
@SuppressWarnings("unchecked")
<V> FluxConcatArray<V> concatAdditionalIgnoredLast(Publisher<? extends V>
    source) {
  int n = array.length;
  Publisher<? extends V>[] newArray = new Publisher[n + 1];
  //noinspection SuspiciousSystemArraycopy
  System.arraycopy(array, 0, newArray, 0, n);
  newArray[n - 1] = Mono.ignoreElements(newArray[n - 1]);
  newArray[n] = source;
  return new FluxConcatArray<>(delayError, newArray);
}

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

static <T> Mono<Void> empty(Publisher<T> source) {
  @SuppressWarnings("unchecked")
  Mono<Void> then = (Mono<Void>)ignoreElements(source);
  return then;
}

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

/**
 * Returns a new instance which has the additional source to be merged together with
 * the current array of sources.
 * <p>
 * This operation doesn't change the current FluxMerge instance.
 *
 * @param source the new source to merge with the others
 * @return the new FluxConcatArray instance
 */
@SuppressWarnings("unchecked")
<V> FluxConcatArray<V> concatAdditionalIgnoredLast(Publisher<? extends V>
    source) {
  int n = array.length;
  Publisher<? extends V>[] newArray = new Publisher[n + 1];
  //noinspection SuspiciousSystemArraycopy
  System.arraycopy(array, 0, newArray, 0, n);
  newArray[n - 1] = Mono.ignoreElements(newArray[n - 1]);
  newArray[n] = source;
  return new FluxConcatArray<>(delayError, newArray);
}

相关文章

Mono类方法