Are there any differences between the following two uses of popen3?
html = ''
stdin, stdout, stderr = Open3.popen3("curl #{url}")
html << stdout.read
and
html = ''
Open3.popen3("curl #{url}") do |stdin, stdout, stderr, wait_thr|
result << stdout.read
end
I’m wondering if the second syntax causes some thread to block. I’m fairly new to asynchronous code so any insights are greatly appreciated!
In the first form you should explicitly close
stdin,stdoutandstderr.