Hello everyone!
What is the difference between Vector{Task}() and Vector{Task}? The code below does not work with Vector{Task}, only with Vector{Task}(). Is there a better way to write this code?
Julia Version 1.7.3
function test_async()
function test(s,i)
sleep(i^2)
open("test_async-$i", "w") do io
println(io, "$s$i")
end
end
v = Vector{Task}() # < --- --- ---
for i=1:3
println("task $i")
v = vcat(v, @async test("Julia language -- $i.", i))
end
wait.(v)
println("test_async()")
end
test_async()