Class: FCGIWrap
Constant Summary collapse
- VERSION =
"0.1.6"
Instance Attribute Summary collapse
-
#cgi ⇒ Object
Returns the value of attribute cgi.
-
#shutdown_p ⇒ Object
Returns the value of attribute shutdown_p.
Class Method Summary collapse
- .cgi ⇒ Object
- .each_request ⇒ Object (also: each, each_cgi, loop)
- .shutdown=(f) ⇒ Object
- .shutdown? ⇒ Boolean
Instance Method Summary collapse
-
#initialize ⇒ FCGIWrap
constructor
A new instance of FCGIWrap.
Constructor Details
#initialize ⇒ FCGIWrap
Returns a new instance of FCGIWrap.
37 38 39 40 |
# File 'lib/fcgiwrap.rb', line 37 def initialize cgi = nil shutdown_p = false end |
Instance Attribute Details
#cgi ⇒ Object
Returns the value of attribute cgi.
41 42 43 |
# File 'lib/fcgiwrap.rb', line 41 def cgi @cgi end |
#shutdown_p ⇒ Object
Returns the value of attribute shutdown_p.
41 42 43 |
# File 'lib/fcgiwrap.rb', line 41 def shutdown_p @shutdown_p end |
Class Method Details
.cgi ⇒ Object
44 45 46 |
# File 'lib/fcgiwrap.rb', line 44 def cgi FCGIWrap.instance.cgi end |
.each_request ⇒ Object Also known as: each, each_cgi, loop
56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 |
# File 'lib/fcgiwrap.rb', line 56 def each_request trap(:PIPE){ exit } trap(:TERM){ self.cgi ? (shutdown = true) : exit } trap(:INT){ self.cgi ? (shutdown = true) : exit } FCGI.each_cgi { |cgi| FCGIWrap.instance.cgi = cgi ENV.clear ENV.update(self.cgi.env_table) begin yield rescue SystemExit shutdown? && raise ensure FCGIWrap.instance.cgi = nil #Thread.list.each { |t| # Thread.current == t and next # t.kill #} end shutdown? && exit } end |
.shutdown=(f) ⇒ Object
52 53 54 |
# File 'lib/fcgiwrap.rb', line 52 def shutdown=(f) FCGIWrap.instance.shutdown_p = f end |
.shutdown? ⇒ Boolean
48 49 50 |
# File 'lib/fcgiwrap.rb', line 48 def shutdown? FCGIWrap.instance.shutdown_p end |