1..num_tasks |> Task.async_stream(fn _ -> :timer.sleep(10000) end, max_concurrency: num_tasks) |> Stream.run()