Nested Task.Supervisor tasks?

I want to start a task that will itself start a couple of other concurrent tasks. Would I use the same Task.Supervisor to do this?

e.g. this is what I’m thinking

Task.Supervisor.start_child(MyTaskSupervisor, fn ->
  info = get_some_info()    
  Task.Supervisor.start_child(MyTaskSupervisor, fn -> child_task1(info) end)
  Task.Supervisor.start_child(MyTaskSupervisor, fn -> child_task2(info) end)
end)

Does this look right?

Seems fine to me yeah?

1 Like