Hello,
I want to trap a ctrl-c, wait for any http request to finish,and then
exit the program. I know I can Kernel#trap , but not sure how to wait
for the network operation to end. Do I need to perform the network
operation in a thread?
Hello,
I want to trap a ctrl-c, wait for any http request to finish,and then
exit the program. I know I can Kernel#trap , but not sure how to wait
for the network operation to end. Do I need to perform the network
operation in a thread?
On Dec 17, 2005, at 11:32 AM, Jim wrote:
Hello,
I want to trap a ctrl-c, wait for any http request to finish,and then
exit the program. I know I can Kernel#trap , but not sure how to wait
for the network operation to end. Do I need to perform the network
operation in a thread?
interrupted = false
trap(“INT”) { interrupted = true }
if interrupted
exit
end
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.
Sponsor our Newsletter | Privacy Policy | Terms of Service | Remote Ruby Jobs