Skip to content

Instantly share code, notes, and snippets.

@benjamintanweihao
Created October 15, 2013 04:25
Show Gist options
  • Select an option

  • Save benjamintanweihao/6986463 to your computer and use it in GitHub Desktop.

Select an option

Save benjamintanweihao/6986463 to your computer and use it in GitHub Desktop.
init([]) ->
Element = {sc_element, {sc_element, start_link, []},
temporary, brutal_kill, worker, [sc_element]},
Children = [Element],
RestartStrategy = {simple_one_for_one, 0, 1},
{ok, {RestartStrategy, Children}}.
@benjamintanweihao
Copy link
Author

  def init([]) do
    children = [
      worker(SimpleCache.Element, [], [restart: :temporary, shutdown: :brutal_kill])
    ]

    supervise(children, strategy: :simple_one_for_one, max_seconds: 1, max_restarts: 0)
  end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment