Simpler pipeline producers

For the producer stage, we are currently passing the name and type via the start_link/2 function:

$ cat apps/elixir_drip/lib/elixir_drip/storage/pipeline/starter.exdefmodule ElixirDrip.Storage.Pipeline.Starter do  use GenStage  require Logger  alias ElixirDrip.Storage.Workers.QueueWorker  @queue_polling 5000  def start_link(name, type) do    GenStage.start_link(__MODULE__, type, name: name)  end  def init(type) do    Logger.debug("#{inspect(self())}: #{type} Pipeline Starter     started.")    {      :producer,      %{queue: QueueWorker.queue_name(type), type: type, pending: 0}    }  end  # ...end

We can see a pattern here: the name argument is only used by the start_link/2 function to set the producer process name when we start it, whereas the ...

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.