small medium large xlarge

21 Jan 2017, 11:33
Levente Bagi (1 post)

On page 232, it says “Second, we have to supervise it separately.”, but there’s no explanation.

Why can’t we just supervise the Server with the main supervisor directly, like below?

def start_workers(sup, initial_number) do
  {:ok, stash} = Supervisor.start_child(sup, worker(Sequence.Stash, [initial_number]))
  Supervisor.start_child(sup, worker(Sequence.Server, [stash]))
You must be logged in to comment