Expose node component management #6769
Open
+188
−97
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.
I wanted to use the framework for composing a node that we have in the gateway without duplicating a lot of the code onflow/flow-evm-gateway#682
The changes I needed were:
FlowNodeImp
has*NodeConfig
which I did not want to use so I pulled out a sub componentNodeImp
that does not have that. This forced me to change some log lines. All the info is still there, but it is in the fields instead of the message.ctx, cancel := context.WithCancel(context.Background())
fromRun
torun
is not strictly necessary, but it was a bit confusing so I refactored it (I can potentially put this in a separate PR)handleComponent
fromFlowNodeBuilder
so I changed it into a function that accepts components and a component builder + the inputAddWorkersFromComponents
. On Flow nodes the input is*NodeConfig
, but with makingReadyDoneFactory
generic the input can be anything.