Hello,
The documentation for Base.isready
says that the function returns true
if there are tasks waiting on a put!
.
However, on Julia 1.8 I tried this:
function unbuffered_channel_test()
channel = Channel{Int64}()
@async begin
for _ in 1:2
println("Waiting on Channel")
v = take!(channel);
println("Got $v")
end
println("Done")
end
sleep(1)
@show isready(channel)
put!(channel, 7)
sleep(1)
@show isready(channel)
put!(channel, 11)
end
And I’m getting this:
julia> unbuffered_channel_test();
Waiting on Channel
isready(channel) = false
Got 7
Waiting on Channel
isready(channel) = false
Got 11
Done
Shouldn’t isready
return true
while the consumer task is blocked on the take!
? Am I misunderstanding something?
Thanks!