Add notes about merge, multiMap, and multiple input channels #3037
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
From some other discussions (#2113 #2682), it looks like some users like to use the following pattern:
multiMap
to split tuple/map into individual channelsmerge
I think this pattern is used in order to avoid having long tuples for process input/output, but actually I think tuples are the best practice here, and this multiMap+merge pattern should be discouraged, because there is a risk of items not being re-combined correctly. I think it happens to work for now but order preservation is not guaranteed in principle.
I think the broader issue is that users would like to have better support for optional inputs/outputs and named inputs (i.e. map input), and this pattern is a sort of workaround for that. But for now I think we should reinforce the best practice in the docs, so in this PR I added some clarifications around use of merge, multiMap, and multiple input channels.