Ruby/CGI : How to detect if browser has requested to "STOP" operation and ignore request
I know that CGI and PHP scripts which take time have this problem of responding to USER requests (client side STOP request from browser) .
The request could 开发者_Go百科be ignored in PHP via ignore_user_abort() call . Is there a similar one for Ruby . I googled through few articles. I found out that we need to ignore SIG_INT to this process .
Is there is a proper way of doing this in CGI/Ruby or CGI in general
Signals are handled using the Signal
class (http://ruby-doc.org/core/classes/Signal.html). You can ignore a signal like so:
Signal.trap("INT", "IGNORE")
精彩评论