Closed sagikazarmark closed 4 years ago
I can explain my intention. I wanted to give the possibility to run every step case in parallel. Treat the context as the holder of the state between steps. Keeping it as it is would give the possibility. I was thinking about the context as an immutable value object. Maybe it's time to change it.
I'm going to change it to a pointer and hide behind the interface you proposed. Then returning the context won't be necessary.
You don't actually have to make it a pointer, because the map behind the context is a reference type. But if you introduce an interface, it won't matter.
Introducing an interface on the other hand might be a backward incompatible change.
Is your feature request related to a problem? Please describe. Returning the context seems unnecessary (since it's internal state is mutated) and it clutters the code.
Describe the solution you'd like Accept the context in the step function parameter list, but don't require returning it.
Describe alternatives you've considered This would make sense if the context was immutable, but it's not.
Additional context Based on our conversation on slack with @bkielbasa I felt like there is a misunderstanding:
Accepting the context as a parameter is OK, having to return it as well seems unnecessary.