pekko icon indicating copy to clipboard operation
pekko copied to clipboard

Feature request: Add `Flow#switchOnFirst` operator for shortcut of `prefixAndtail(1).flatmapConcat(..)` ?

Open He-Pin opened this issue 1 year ago • 1 comments

Motivation: I find it's very common to write code as prefixAndTail(1).flatMapConcat(...), this kind is just something like Flux#switchOnFirst. And more fine control can be done with the prefixAndTail but I think for most case is prefixAndTail(1).flatMapConcat(...) like thing.

Result: Simpler code for common use case.

He-Pin avatar Jan 20 '24 09:01 He-Pin

The prefixAndTail(1).flatMapConcat(...) is indeed incredibly common, but not so convinced with the switchOnFirst name. How about popAndFlatMapConcat? I think this terminology is closer to Akka/Pekko

Open to other suggestions as well

mdedetrich avatar Jan 20 '24 09:01 mdedetrich