Collecting the pipeline worker specs

The goal is now to generate and aggregate the worker specs of each stage, while also passing them the process names of the previous stage (except on the first producer stage, which doesn't subscribe to any stage).

This is exactly what the following pipeline_specs/1 function does: it starts by reducing all the steps it receives. When the resulting worker_specs is empty, it means we are looking at the first producer step, so we simply add the outcome of get_worker_specs(step) to the end result. If it isn't empty, it means we are processing a ProducerConsumer or a Consumer stage, so we need to add the names_to_subscribe keyword to the step before getting its worker specs:

$ cat apps/elixir_drip/lib/elixir_drip/dsl/pipeliner.ex ...

Get Mastering Elixir now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.