async
async copied to clipboard
gets() hangs on Windows
Hi, Running this on Mac and Linux:
input, output = IO.pipe
Async do
puts "starting"
Async do
puts "reading..."
line = input.gets
puts "got #{line.inspect}"
end
puts "writting..."
output.puts "hello"
end
outputs:
starting
reading...
writting...
got "hello\n"
But on Windows it just outputs:
starting
reading...
and then hangs. It seems the call to input.gets()blocks?
I'm running the Windows code in a Github Workflow: Microsoft Windows Server 2022, 10.0.20348 ruby 3.2.2 (2023-03-30 revision e51014f9c0) [x64-mingw-ucrt] Using async 2.6.2 Using async-io 1.35.0 Using bundler 2.4.13
I cannot reproduce this with async 2.6.3, closing.
Wow great, thanks for reporting back!
It seems I was too quick to close this. The original example at the top still hangs on Windows. As mentioned, I'm running this in a GitHub Action, that runs a Ruby file with the example in.
I'll try to make a PR with a new test.
Hi, Any plans for adding Windows to the test matrix? This seems still to hang on Windows.
Yes, but it's slow. I started writing support for IOCP in io-event gem.
Cool, thank you for the response.