Created
August 10, 2015 18:56
-
-
Save myronmarston/1bbd09f768ced1d6a7cf to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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