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

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

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

Flux.tuple2Function介绍

暂无

代码示例

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

/**
 * Keep information about the order in which source values were received by
 * indexing them with a 0-based incrementing long, returning a {@link Flux}
 * of {@link Tuple2 Tuple2<(index, value)>}.
 *
 * @return an indexed {@link Flux} with each source value combined with its 0-based index.
 */
public final Flux<Tuple2<Long, T>> index() {
  return index(tuple2Function());
}

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

/**
 * Zip elements from this {@link Flux} with the content of an {@link Iterable}, that is
 * to say combine one element from each, pairwise, into a {@link Tuple2}.
 *
 * <p>
 * <img class="marble" src="doc-files/marbles/zipWithIterableForFlux.svg" alt="">
 *
 * @param iterable the {@link Iterable} to zip with
 * @param <T2> the value type of the other iterable sequence
 *
 * @return a zipped {@link Flux}
 *
 */
@SuppressWarnings("unchecked")
public final <T2> Flux<Tuple2<T, T2>> zipWithIterable(Iterable<? extends T2> iterable) {
  return zipWithIterable(iterable, tuple2Function());
}

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

/**
 * Combine the result from this mono and another into a {@link Tuple2}.
 * <p>
 * An error or <strong>empty</strong> completion of any source will cause the other source
 * to be cancelled and the resulting Mono to immediately error or complete, respectively.
 *
 * <p>
 * <img class="marble" src="doc-files/marbles/zipWithOtherForMono.svg" alt="">
 *
 * @param other the {@link Mono} to combine with
 * @param <T2> the element type of the other Mono instance
 *
 * @return a new combined Mono
 */
public final <T2> Mono<Tuple2<T, T2>> zipWith(Mono<? extends T2> other) {
  return zipWith(other, Flux.tuple2Function());
}

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

/**
 * Zip this {@link Flux} with another {@link Publisher} source, that is to say wait
 * for both to emit one element and combine these elements once into a {@link Tuple2}.
 * The operator will continue doing so until any of the sources completes.
 * Errors will immediately be forwarded.
 * This "Step-Merge" processing is especially useful in Scatter-Gather scenarios.
 *
 * <p>
 * <img class="marble" src="doc-files/marbles/zipWithOtherForFlux.svg" alt="">
 *
 * @param source2 The second source {@link Publisher} to zip with this {@link Flux}.
 * @param prefetch the request size to use for this {@link Flux} and the other {@link Publisher}
 * @param <T2> type of the value from source2
 *
 * @return a zipped {@link Flux}
 */
public final <T2> Flux<Tuple2<T, T2>> zipWith(Publisher<? extends T2> source2, int prefetch) {
  return zipWith(source2, prefetch, tuple2Function());
}

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

/**
 * Zip this {@link Flux} with another {@link Publisher} source, that is to say wait
 * for both to emit one element and combine these elements once into a {@link Tuple2}.
 * The operator will continue doing so until any of the sources completes.
 * Errors will immediately be forwarded.
 * This "Step-Merge" processing is especially useful in Scatter-Gather scenarios.
 * <p>
 * <img class="marble" src="doc-files/marbles/zipWithOtherForFlux.svg" alt="">
 *
 * @param source2 The second source {@link Publisher} to zip with this {@link Flux}.
 * @param <T2> type of the value from source2
 *
 * @return a zipped {@link Flux}
 *
 */
public final <T2> Flux<Tuple2<T, T2>> zipWith(Publisher<? extends T2> source2) {
  return zipWith(source2, tuple2Function());
}

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

/**
 * Merge given monos into a new {@literal Mono} that will be fulfilled when all of the given {@literal Monos}
 * have produced an item, aggregating their values into a {@link Tuple2}.
 * An error or <strong>empty</strong> completion of any source will cause other sources
 * to be cancelled and the resulting Mono to immediately error or complete, respectively.
 *
 * <p>
 * <img class="marble" src="doc-files/marbles/zipFixedSourcesForMono.svg" alt="">
 * <p>
 * @param p1 The first upstream {@link Publisher} to subscribe to.
 * @param p2 The second upstream {@link Publisher} to subscribe to.
 * @param <T1> type of the value from p1
 * @param <T2> type of the value from p2
 *
 * @return a {@link Mono}.
 */
public static <T1, T2> Mono<Tuple2<T1, T2>> zip(Mono<? extends T1> p1, Mono<? extends T2> p2) {
  return zip(p1, p2, Flux.tuple2Function());
}

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

/**
 * Zip two sources together, that is to say wait for all the sources to emit one
 * element and combine these elements once into a {@link Tuple2}.
 * The operator will continue doing so until any of the sources completes.
 * Errors will immediately be forwarded.
 * This "Step-Merge" processing is especially useful in Scatter-Gather scenarios.
 * <p>
 * <img class="marble" src="doc-files/marbles/zipFixedSourcesForFlux.svg" alt="">
 *
 * @param source1 The first {@link Publisher} source to zip.
 * @param source2 The second {@link Publisher} source to zip.
 * @param <T1> type of the value from source1
 * @param <T2> type of the value from source2
 *
 * @return a zipped {@link Flux}
 */
public static <T1, T2> Flux<Tuple2<T1, T2>> zip(Publisher<? extends T1> source1, Publisher<? extends T2> source2) {
  return zip(source1, source2, tuple2Function());
}

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

/**
 * Keep information about the order in which source values were received by
 * indexing them with a 0-based incrementing long, returning a {@link Flux}
 * of {@link Tuple2 Tuple2<(index, value)>}.
 *
 * @return an indexed {@link Flux} with each source value combined with its 0-based index.
 */
public final Flux<Tuple2<Long, T>> index() {
  return index(tuple2Function());
}

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

/**
 * Combine the result from this mono and another into a {@link Tuple2}.
 * <p>
 * An error or <strong>empty</strong> completion of any source will cause the other source
 * to be cancelled and the resulting Mono to immediately error or complete, respectively.
 *
 * <p>
 * <img class="marble" src="doc-files/marbles/zipWithOtherForMono.svg" alt="">
 *
 * @param other the {@link Mono} to combine with
 * @param <T2> the element type of the other Mono instance
 *
 * @return a new combined Mono
 */
public final <T2> Mono<Tuple2<T, T2>> zipWith(Mono<? extends T2> other) {
  return zipWith(other, Flux.tuple2Function());
}

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

/**
 * Zip elements from this {@link Flux} with the content of an {@link Iterable}, that is
 * to say combine one element from each, pairwise, into a {@link Tuple2}.
 *
 * <p>
 * <img class="marble" src="doc-files/marbles/zipWithIterableForFlux.svg" alt="">
 *
 * @param iterable the {@link Iterable} to zip with
 * @param <T2> the value type of the other iterable sequence
 *
 * @return a zipped {@link Flux}
 *
 */
@SuppressWarnings("unchecked")
public final <T2> Flux<Tuple2<T, T2>> zipWithIterable(Iterable<? extends T2> iterable) {
  return zipWithIterable(iterable, tuple2Function());
}

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

/**
 * Zip two sources together, that is to say wait for all the sources to emit one
 * element and combine these elements once into a {@link Tuple2}.
 * The operator will continue doing so until any of the sources completes.
 * Errors will immediately be forwarded.
 * This "Step-Merge" processing is especially useful in Scatter-Gather scenarios.
 * <p>
 * <img class="marble" src="doc-files/marbles/zipFixedSourcesForFlux.svg" alt="">
 *
 * @param source1 The first {@link Publisher} source to zip.
 * @param source2 The second {@link Publisher} source to zip.
 * @param <T1> type of the value from source1
 * @param <T2> type of the value from source2
 *
 * @return a zipped {@link Flux}
 */
public static <T1, T2> Flux<Tuple2<T1, T2>> zip(Publisher<? extends T1> source1, Publisher<? extends T2> source2) {
  return zip(source1, source2, tuple2Function());
}

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

/**
 * Zip this {@link Flux} with another {@link Publisher} source, that is to say wait
 * for both to emit one element and combine these elements once into a {@link Tuple2}.
 * The operator will continue doing so until any of the sources completes.
 * Errors will immediately be forwarded.
 * This "Step-Merge" processing is especially useful in Scatter-Gather scenarios.
 * <p>
 * <img class="marble" src="doc-files/marbles/zipWithOtherForFlux.svg" alt="">
 *
 * @param source2 The second source {@link Publisher} to zip with this {@link Flux}.
 * @param <T2> type of the value from source2
 *
 * @return a zipped {@link Flux}
 *
 */
public final <T2> Flux<Tuple2<T, T2>> zipWith(Publisher<? extends T2> source2) {
  return zipWith(source2, tuple2Function());
}

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

/**
 * Zip this {@link Flux} with another {@link Publisher} source, that is to say wait
 * for both to emit one element and combine these elements once into a {@link Tuple2}.
 * The operator will continue doing so until any of the sources completes.
 * Errors will immediately be forwarded.
 * This "Step-Merge" processing is especially useful in Scatter-Gather scenarios.
 *
 * <p>
 * <img class="marble" src="doc-files/marbles/zipWithOtherForFlux.svg" alt="">
 *
 * @param source2 The second source {@link Publisher} to zip with this {@link Flux}.
 * @param prefetch the request size to use for this {@link Flux} and the other {@link Publisher}
 * @param <T2> type of the value from source2
 *
 * @return a zipped {@link Flux}
 */
public final <T2> Flux<Tuple2<T, T2>> zipWith(Publisher<? extends T2> source2, int prefetch) {
  return zipWith(source2, prefetch, tuple2Function());
}

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

/**
 * Merge given monos into a new {@literal Mono} that will be fulfilled when all of the given {@literal Monos}
 * have produced an item, aggregating their values into a {@link Tuple2}.
 * An error or <strong>empty</strong> completion of any source will cause other sources
 * to be cancelled and the resulting Mono to immediately error or complete, respectively.
 *
 * <p>
 * <img class="marble" src="doc-files/marbles/zipFixedSourcesForMono.svg" alt="">
 * <p>
 * @param p1 The first upstream {@link Publisher} to subscribe to.
 * @param p2 The second upstream {@link Publisher} to subscribe to.
 * @param <T1> type of the value from p1
 * @param <T2> type of the value from p2
 *
 * @return a {@link Mono}.
 */
public static <T1, T2> Mono<Tuple2<T1, T2>> zip(Mono<? extends T1> p1, Mono<? extends T2> p2) {
  return zip(p1, p2, Flux.tuple2Function());
}

相关文章

微信公众号

最新文章

更多

Flux类方法