Skip to content

Instantly share code, notes, and snippets.

@myronmarston
Created August 10, 2015 18:56
Show Gist options
  • Save myronmarston/1bbd09f768ced1d6a7cf to your computer and use it in GitHub Desktop.
Save myronmarston/1bbd09f768ced1d6a7cf to your computer and use it in GitHub Desktop.
defmodule Delorean.RankingsShardRepository.RunningShard.Supervisor do
use Supervisor
def start_link(opts) do
Supervisor.start_link(__MODULE__, opts, [])
end
def start_shard(supervisor, shard_opts) do
Supervisor.start_child(supervisor, shard_opts)
end
def init(shard_opts) do
children = [
worker(Delorean.RankingsShardRepository.RunningShard, shard_opts, restart: :temporary)
]
supervise(children, strategy: :simple_one_for_one)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment