Open akarnokd opened 4 years ago
To fill out the rest of your list with what the core implementation does:
forEach
-> uses Stage.Collect
ignore
-> same as forEach
but with an empty actionreduce
-> implements the reduction operation as a Collector
and uses Stage.Collect
to(SubscriberBuilder)
/ via(ProcessorBuilder)
-> these don't have a corresponding stage. Instead the stages from the SubscriberBuilder
or ProcessorBuilder
are added to the graph. The core implementation actually creates an internal nested
stage which is removed when toGraph()
is called.You're correct that there isn't a 1:1 mapping between builder methods and stages. I'm not sure why that decision was taken.
Looks like some of the
ReactiveStreamsFactory
based sources do not have aStage
equivalent:empty
-> could be mimicked withStage.Of
returning an empty collection, but less efficientof(T)
-> could be mimicked withStage.Of
returning an empty collection, but less efficientof(T...)
-> could be mimicked withStage.Of
returning an empty collection, but less efficientiterate
-> could be mimicked withStage.Of
, but less efficientgenerate
-> could be mimicked withStage.Of
, but less efficientforEach
ignore
-> there is aStage.Cancel
thoughreduce(T, BinaryOperator)
-> there isFindFirst
thoughreduce(BinaryOperator)
collect(Supplier, BiConsumer)
-> there isCollect
withjava.util.stream.Collector
thoughtoList
-> could be mimicked viaCollect
, but it is inefficient into(SubscriberBuilder)
-> is thisStage.SubscriberStage
too, ignoring theCompletionStage
?via(ProcessorBuilder)
-> is thisStage.ProcessorStage
too?