fun <T : Number> Flux<T>.sum(): Mono<Long>
Extension to compute the Long sum of all values emitted by a Flux of Number and return it as a Mono of Long.
Note that summing decimal numbers with this method loses precision, see sumDouble.
Author
Simon Baslé
Since
1.0.0
Deprecated
Please use sumAsLong() as a direct replacement, or consider more general purpose sumAll().
To be removed at the earliest in 1.3.0.
fun <T> Flux<T>.sum(mapper: (T) -> Number): Mono<Long>
Extension to map arbitrary values in a Flux to Numbers and return the sum of these Numbers as a Mono of Long.
Float and Double are rounded to Long by MathFlux, using Java standard conversions.
mapper
- a lambda converting values to Number
Author
Simon Baslé
Since
1.0.0
Deprecated
Please use sumAll(mapper) as a direct replacement,
providing a mapping function that returns a Long. To be removed at the earliest in 1.3.0.