I tried, it still doesn't work.

function nice()
    i=1
    while true
        let j=i
            f() = j
            produce(f)
        end
        i+=1
    end
end
ye = Task(() -> nice())
funcs = Function[]
for k in [1:2]
    push!(funcs,consume(ye))
end

println(funcs[1]())
println(funcs[2]())

Reply via email to