Skip to content

Instantly share code, notes, and snippets.

@alvises
Created September 15, 2016 13:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alvises/073a5b0c7215313e6e485b01f38af412 to your computer and use it in GitHub Desktop.
Save alvises/073a5b0c7215313e6e485b01f38af412 to your computer and use it in GitHub Desktop.
supervised genstages
{:ok, p} = Producer.start_link
children = [
worker(ProducerConsumer, [:pc_1], id: 1),
worker(ProducerConsumer, [:pc_2], id: 2)
]
{:ok, sup} = Supervisor.start_link children, strategy: :one_for_one
{:ok, consumer} = Consumer.start [:pc_1, :pc_2]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment