For task supervisors, the processes can only be restarted when using start_child method. We cannot currently await on a task that we want to retry.
{:ok, tas} = Task.Supervisor.start_link(restart: :transient)
Task.Supervisor.async_nolink(tas, fn -> 1 = 2 end)
// does not restart
I understand there is a limitation that a Task is tied to a process, so it cannot possibly know about the new process that could get started. But this was unclear in the documentation.
Do you think there is a way to await on a supervised task that be restarted on crash? If so we should implement it because there is many cases where this could be helpful. If not I think we should clarify this in the docs more.