-
Notifications
You must be signed in to change notification settings - Fork 182
Open
Labels
t:streamPekko StreamsPekko Streams
Milestone
Description
Motivation:
Using an inline transform
method can get more fluent code as Flux
.
When using reactor-core 's Flux
, we have something like:
sink.asFlux()
.onBackpressureBuffer()
.transform(new MsgTransformer())
.subscribe(msgs -> {
... }
And the transform
method is just a syntax sugar:
public final <V> Flux<V> transform(Function<? super Flux<T>, ? extends Publisher<V>> transformer) {
if (Hooks.DETECT_CONTEXT_LOSS) {
transformer = new ContextTrackingFunctionWrapper(transformer);
}
return onAssembly(from(transformer.apply(this)));
}
WDYT?
Result:
More fluent code.
jxnu-liguobin
Metadata
Metadata
Assignees
Labels
t:streamPekko StreamsPekko Streams