reactor / reactor-core

Non-Blocking Reactive Foundation for the JVM
http://projectreactor.io
Apache License 2.0
4.93k stars 1.19k forks source link

Composite Operator Operator #1034

Closed nebhale closed 3 years ago

nebhale commented 6 years ago

Currently, it is not possible create an operator that is a composite of other operators because there is no way to know about both the requested demand and the emitted signals in the same operator. For example, supposed you needed to re-implement windowing (because of say #1033). In order to do this, you'd need both the downstream signals in order to partition the Flux as well as upstream requests in order to ensure that you were respecting demand and propagating back pressure accordingly.

Now, creating a new operator which has access to all of this information is possible, but given the complexities of ensuring that nothing is blocking, that you're propagating back pressure properly, and then of course getting operator fusion right, it's unlikely that most users will be skilled enough to properly implement a custom operator correctly. And at the same time, I don't think that Reactor should be in the business of implementing each and every operator that is useful to a small corner of the community. I think there needs to be a convenient middle ground that allows me to create operators that are useful only to me while building on top of Reactor's public APIs.

simonbasle commented 3 years ago

closing as it has been sitting around for a while without any progress. coming up with a satisfactory intermediate abstraction is a major challenge.