The notifier stage

Let's now analyze our ElixirDrip upload stages by starting from the very end with our Notifier stage. As we just saw, when the pipeline-supervision tree starts, it passes a name and the subscription options to each stage. In this case, we start the process as a consumer with no relevant state:

$ cat apps/elixir_drip/lib/elixir_drip/storage/pipeline/notifier.exdefmodule ElixirDrip.Storage.Pipeline.Notifier do  use GenStage  require Logger  @dummy_state []  def start_link(name, subscription_options),    do: GenStage.start_link(__MODULE__, subscription_options, name: name)  def init(subscription_options),    do: {:consumer, @dummy_state, subscription_options}  # implementing the GenStage.handle_events/3 callback # we delegate the event ...

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.