2005-06-22 11:18:01 +00:00
|
|
|
class Dispatcher
|
|
|
|
class <<self
|
|
|
|
attr_accessor :time_to_sleep
|
|
|
|
attr_accessor :raise_exception
|
2005-07-02 04:52:14 +00:00
|
|
|
attr_accessor :dispatch_hook
|
2005-06-22 11:18:01 +00:00
|
|
|
|
2005-07-13 02:12:00 +00:00
|
|
|
def dispatch(cgi, session_options = nil, output = $stdout)
|
2005-07-02 04:52:14 +00:00
|
|
|
dispatch_hook.call(cgi) if dispatch_hook
|
2005-06-22 11:18:01 +00:00
|
|
|
sleep(time_to_sleep || 0)
|
|
|
|
raise raise_exception, "Something died" if raise_exception
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|