1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
rails--rails/railties/test/mocks/fcgi.rb
Jeremy Kemper 5650bc9094 r1588@asus: jeremy | 2005-07-02 03:14:45 -0700
Optional periodic garbage collection for dispatch.fcgi.  Graceful exit on TERM also (a la Apache1).  Ignore signals the platform does not support, such as USR1 on Windows.


git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1592 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-07-02 04:52:14 +00:00

15 lines
344 B
Ruby

class FCGI
class << self
attr_accessor :time_to_sleep
attr_accessor :raise_exception
attr_accessor :each_cgi_count
def each_cgi
(each_cgi_count || 1).times do
sleep(time_to_sleep || 0)
raise raise_exception, "Something died" if raise_exception
yield "mock cgi value"
end
end
end
end