Class: FnordMetric::Reactor
- Inherits:
-
Object
- Object
- FnordMetric::Reactor
- Defined in:
- lib/fnordmetric/web/reactor.rb
Instance Method Summary collapse
- #execute(*args) ⇒ Object
-
#initialize ⇒ Reactor
constructor
A new instance of Reactor.
- #ready! ⇒ Object
Constructor Details
#initialize ⇒ Reactor
Returns a new instance of Reactor.
3 4 5 6 |
# File 'lib/fnordmetric/web/reactor.rb', line 3 def initialize @redis = FnordMetric.mk_redis @namespaces = FnordMetric.namespaces.dup end |
Instance Method Details
#execute(*args) ⇒ Object
14 15 16 17 18 19 20 |
# File 'lib/fnordmetric/web/reactor.rb', line 14 def execute(*args) execute_unsafe(*args) rescue Exception => e FnordMetric.error("reactor crashed: " + e.to_s) puts (e.backtrace * "\n") if ENV["FNORDMETRIC_ENV"] == "dev" [] end |
#ready! ⇒ Object
8 9 10 11 12 |
# File 'lib/fnordmetric/web/reactor.rb', line 8 def ready! @namespaces.each do |key, ns| ns.ready!(@redis) end end |