3 ms·
It seems that each stage will need to know about at least two directories, an input directory and an output directory. If it was implemented with a chain type
by DougBTX 13y ago
It seems that each stage will need to know about at least two directories, an input directory and an output directory.
If it was implemented with a chain type and a stage type, the "run it" command would presumably have to read the directory for the second stage, then pass that into the first stage as an argument when processing the chain.
Alternativly, each stage could have a directory property and a next stage property. Then when the stage runs, it could ask its next stage for the output directory. There wouldn't be a chain type as such, only links in the chain of stages. The "status report" query would return a list of statuses by prepending its status to the "status report" of the next stage. Joining two chains would compose by joining the last stage of one with the first stage of the other. To run the chain, there would only need to be a reference to the first stage.
The linked-list of stages might have too much flexibility, for example there would be nothing to stop you having a particular type of stage which branches out to multiple other stages, and there may need to be safeguards against loops in the chain, say, by making the next-stage property immutable - though that would force the chain the be built up in reverse, which may be inconvenient.