Skip to Main Content
Mastering Elixir
book

Mastering Elixir

by André Albuquerque, Daniel Caixinha
July 2018
Intermediate to advanced content levelIntermediate to advanced
574 pages
14h 7m
English
Packt Publishing
Content preview from Mastering Elixir

Simpler pipeline (producer) consumers

The approach we'll now adopt is really similar to the previous one for producer stages. Currently, this is what the RemoteStorage stage looks like:

$ cat apps/elixir_drip/lib/elixir_drip/storage/pipeline/remote_storage.exdefmodule ElixirDrip.Storage.Pipeline.RemoteStorage do  use GenStage  require Logger  alias ElixirDrip.Storage  alias Storage.Provider  alias Storage.Supervisors.CacheSupervisor, as: Cache  @dummy_state []  def start_link(name, subscription_options),    do: GenStage.start_link(__MODULE__, subscription_options, name: name)  def init(subscription_options) do    Logger.debug("#{inspect(self())}: Pipeline RemoteStorage started.     Options: #{inspect(subscription_options)}") {:producer_consumer, @dummy_state, ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Testing Elixir

Testing Elixir

Andrea Leopardi, Jeffrey Matthias

Publisher Resources

ISBN: 9781788472678Supplemental Content