Package reactor.kotlin.core.publisher

Functions

Link copied to clipboard
inline fun <T : Any> Flux<*>.cast(): Flux<T>

Extension for Flux.cast providing a cast<Foo>() variant.

inline fun <T : Any> Mono<*>.cast(): Mono<T>

Extension for Mono.cast providing a cast<Foo>() variant.

Link copied to clipboard
fun <T, E : Throwable> Flux<T>.doOnError(exceptionType: KClass<E>, onError: (E) -> Unit): Flux<T>

Extension for Flux.doOnError providing a KClass based variant.

fun <T, E : Throwable> Mono<T>.doOnError(exceptionType: KClass<E>, onError: (E) -> Unit): Mono<T>

Extension for Mono.doOnError providing a KClass based variant.

Link copied to clipboard
inline fun <T : Any> Flux<*>.ofType(): Flux<T>

Extension for Flux.ofType providing a ofType<Foo>() variant.

inline fun <T : Any> Mono<*>.ofType(): Mono<T>

Extension for Mono.ofType providing a ofType<Foo>() variant.

Link copied to clipboard
fun <T, E : Throwable> Flux<T>.onErrorMap(exceptionType: KClass<E>, mapper: (E) -> Throwable): Flux<T>

Extension for Flux.onErrorMap providing a KClass based variant.

fun <T, E : Throwable> Mono<T>.onErrorMap(exceptionType: KClass<E>, mapper: (E) -> Throwable): Mono<T>

Extension for Mono.onErrorMap providing a KClass based variant.

fun <E : Throwable, T> Mono<T>.onErrorMap(    type: KClass<E>,     predicate: (E) -> Boolean,     mapper: (E) -> Throwable): Mono<T>

Extension for Mono.onErrorMap providing a KClass based variant and predicate.

Link copied to clipboard
fun <T : Any, E : Throwable> Flux<T>.onErrorResume(exceptionType: KClass<E>, fallback: (E) -> Publisher<T>): Flux<T>

Extension for Flux.onErrorResume providing a KClass based variant.

fun <T : Any, E : Throwable> Mono<T>.onErrorResume(exceptionType: KClass<E>, fallback: (E) -> Mono<T>): Mono<T>

Extension for Mono.onErrorResume providing a KClass based variant.

Link copied to clipboard
fun <T : Any, E : Throwable> Flux<T>.onErrorReturn(exceptionType: KClass<E>, value: T): Flux<T>

Extension for Flux.onErrorReturn providing a KClass based variant.

fun <T : Any, E : Throwable> Mono<T>.onErrorReturn(exceptionType: KClass<E>, value: T): Mono<T>

Extension for Mono.onErrorReturn providing a KClass based variant.

Link copied to clipboard
fun <T : Any> Flux<out Iterable<T>>.split(): Flux<T>

Extension for flattening Flux of Iterable

Link copied to clipboard
fun <T> Mono<T>.switchIfEmpty(s: () -> Mono<T>): Mono<T>

Extension for Mono.switchIfEmpty accepting a function providing a Mono. This allows having a deferred execution with the switchIfEmpty operator

Link copied to clipboard
fun <T> Flux<T>.switchIfEmptyDeferred(s: () -> Publisher<T>): Flux<T>

Extension for Flux.switchIfEmpty accepting a function providing a Publisher. This allows having a deferred execution with the switchIfEmpty operator

Link copied to clipboard
fun <T : Any> Stream<T>.toFlux(): Flux<T>

Extension for transforming a Stream to a Flux.

fun <T> Array<out T>.toFlux(): Flux<T>

Extension for transforming an Array to a Flux.

fun BooleanArray.toFlux(): Flux<Boolean>

Extension for transforming a BooleanArray to a Flux.

fun ByteArray.toFlux(): Flux<Byte>

Extension for transforming a ByteArray to a Flux.

fun DoubleArray.toFlux(): Flux<Double>

Extension for transforming a DoubleArray to a Flux.

fun FloatArray.toFlux(): Flux<Float>

Extension for transforming a FloatArray to a Flux.

fun IntArray.toFlux(): Flux<Int>

Extension for transforming a IntArray to a Flux.

fun LongArray.toFlux(): Flux<Long>

Extension for transforming a LongArray to a Flux.

fun ShortArray.toFlux(): Flux<Short>

Extension for transforming a ShortArray to a Flux.

fun <T> Throwable.toFlux(): Flux<T>

Extension for transforming an exception to a Flux that completes with the specified error.

fun <T : Any> Iterable<T>.toFlux(): Flux<T>

Extension for transforming an Iterable to a Flux.

fun <T : Any> Iterator<T>.toFlux(): Flux<T>

Extension for transforming an Iterator to a Flux.

fun <T : Any> Sequence<T>.toFlux(): Flux<T>

Extension for transforming a Sequence to a Flux.

fun <T : Any> Publisher<T>.toFlux(): Flux<T>

Extension to convert any Publisher of T to a Flux.

Link copied to clipboard
fun <T : Any> T?.toMono(): Mono<T>

Extension for transforming a nullable object to a Mono.

fun <T> Callable<T?>.toMono(): Mono<T>

Extension for transforming an Callable to a Mono.

fun <T> CompletableFuture<out T?>.toMono(): Mono<T>

Extension for transforming an CompletableFuture to a Mono.

fun <T> () -> T?.toMono(): Mono<T>

Extension to convert any Supplier of T to a Mono that emits supplied element.

fun <T> Throwable.toMono(): Mono<T>

Extension for transforming an exception to a Mono that completes with the specified error.

fun <T> Publisher<T>.toMono(): Mono<T>

Extension to convert any Publisher of T to a Mono that only emits its first element.

Link copied to clipboard
fun Iterable<Publisher<*>>.whenComplete(): Mono<Void>

Aggregates this Iterable of void Publishers into a new Mono. An alias for a corresponding Mono.when to avoid use of when, which is a keyword in Kotlin.

fun whenComplete(vararg sources: Publisher<*>): Mono<Void>

Aggregates the given void Publishers into a new void Mono. An alias for a corresponding Mono.when to avoid use of when, which is a keyword in Kotlin.

Link copied to clipboard
inline fun <T, R> Iterable<Mono<T>>.zip(crossinline combinator: (List<T>) -> R): Mono<R>

Merges this Iterable of Monos into a new Mono by combining them with combinator.

fun <R> zip(vararg monos: Mono<*>, combinator: (Array<*>) -> R): Mono<R>

Aggregates the given Monos into a new Mono.