       case Task.yield(task, timeout) || Task.shutdown(task) do
         {:ok, result} ->
           result
+
         nil ->
-          Logger.warn "Failed to get a result in #{timeout}ms"
+          Logger.warn("Failed to get a result in #{timeout}ms")
           nil
       end
 


      Task.Supervisor.async(MyApp.TaskSupervisor, fn ->
        # Do something
      end) |> Task.await()

  Finally, check `Task.Supervisor` for other supported operations.



      tasks_with_results = Task.yield_many(tasks, 5000)

      results =
        Enum.map(tasks_with_results, fn {task, res} ->
          # Shutdown the tasks that did not reply nor exit
          res || Task.shutdown(task, :brutal_kill)
        end)

      # Here we are matching only on {:ok, value} and
      # ignoring {:exit, _} (crashed tasks) and `nil` (no replies)
      for {:ok, value} <- results do
        IO.inspect(value)
      end

  In the example above, we create tasks that sleep from 1
