Skip to content
This repository was archived by the owner on Mar 2, 2022. It is now read-only.

Commit 84aa58d

Browse files
committed
Added SParallelFlux.as
Signed-off-by: Winarto Zhao <[email protected]>
1 parent f939468 commit 84aa58d

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/main/scala/reactor/core/scala/publisher/SParallelFlux.scala

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,17 @@ import reactor.core.publisher.{ParallelFlux => JParallelFlux}
88
import reactor.util.concurrent.Queues
99

1010
class SParallelFlux[T] private(private val jParallelFlux: JParallelFlux[T]) {
11+
12+
/**
13+
* Perform a fluent transformation to a value via a converter function which receives
14+
* this ParallelFlux.
15+
*
16+
* @tparam U the output value type
17+
* @param converter the converter function from [[SParallelFlux]] to some type
18+
* @return the value returned by the converter function
19+
*/
20+
final def as[U](converter: SParallelFlux[T] => U): U = jParallelFlux.as((t: JParallelFlux[T]) => converter(SParallelFlux(t)))
21+
1122
def asJava: JParallelFlux[T] = jParallelFlux
1223
}
1324

0 commit comments

Comments
 (0)