rohd
rohd copied to clipboard
Add support to "name" `Pipeline` stages and reference them by name
Motivation
Different stages of a pipeline may have meaningful names associated with them, and logic from within or outside the pipeline may want to access a certain stage's signal by name rather than absolute index. This helps make refactoring pipelines even easier, since adding a stage will not modify stage names.
Desired solution
Add to or extend functionality of Pipeline
s to support naming stages.
Additional details
Some thought has to be put into where the name goes and what the type of the name should be. Should it always be a String
or should it be parameterized so that an enum
could be used? The current implementation is a List<List<Conditional> Function(PipelineStageInfo p)>
, so modifying the input to Pipeline
s to accept some new List
or a Map
would be a significant API change, but maybe it is appropriate so that more functionality can be more easily added in the future.
When creating this, we can also add new capabilities like adding the stall signals as part of the stage themselves instead of as a separate input into the Pipeline abstraction.
Can we extend Function
to maintain backwards compatibility or is that not reasonable/possible?
Can we extend
Function
to maintain backwards compatibility or is that not reasonable/possible?
Apparently, no: https://github.com/dart-lang/sdk/issues/33748