Supposing I am building a flow operator that uses channel flow, and I know the upstream flow is also a channel flow, can I make them fuse?
AFAIK this won’t fuse:
… to be clear, I don’t think not fusing in this case is a problem since it’s just a perf optimization as far as I understand. Just curious if there’s a publicly exposed way (since FusibleFlow, ChannelFlowOperator, etc are internal)
👀 1
☝️ 1
d
Daniel Pitts
12/07/2023, 10:44 PM
It doesn't look like there is a way to do that. I don't even think it's an optimization really. The thing that "fusing" does is combine the configuration of buffer/context of the flow.
Daniel Pitts
12/07/2023, 10:46 PM
Though it seems like this would be better structured as
Copy code
channelFlow {
send(1)
}.map { it }
p
Patrick Steiger
12/08/2023, 1:02 AM
Example is contrived, actual code needs to populate the downstream channel from multiple coroutines, where 1 of them is collecting from upstream channel flow and sending to downstream channel flow
Patrick Steiger
12/08/2023, 1:05 AM
Thanks for answering though, I think it’s indeed not possible
Patrick Steiger
12/08/2023, 1:18 AM
Also you’re right fusing is not (just?) for optimization purposes, since fusing has its own logic for somehow combines the configs (either overriding, or summing, etc