Dynamic compute graph using Genstage?

May I ask what you are trying to achieve? Because at first glance it seems you are using GenStage pipelines to model code-based concerns while stages should be added when you need to model runtime concerns (such as failures and/or back-pressure).

In other words, I would solve this problem by having a stage that knows how to call subtract 7 or subtract 4 accordingly, without touching the stage organization. In the same way any code you write may swap between two function calls by using conditionals.

There is a chance all of your stages above could be a simple stage.

1 Like