Class: Hato::Observer
- Inherits:
-
Object
- Object
- Hato::Observer
- Defined in:
- lib/hato/observer.rb
Instance Method Summary collapse
-
#initialize(config) ⇒ Observer
constructor
A new instance of Observer.
- #update(args) ⇒ Object
Constructor Details
#initialize(config) ⇒ Observer
Returns a new instance of Observer.
5 6 7 |
# File 'lib/hato/observer.rb', line 5 def initialize(config) @config = config end |
Instance Method Details
#update(args) ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/hato/observer.rb', line 9 def update(args) logger = args.delete(:logger) plugins = load_plugins_for(args[:tag]) plugins.each do |plugin| Thread.start(plugin) do |t| begin t.notify(args) rescue => e logger.error("#{e.} from #{t.class}") end end end end |