Class: ActiveSupport::Notifications::Fanout::Subscribers::EventObject

Inherits:
Evented
  • Object
show all
Defined in:
lib/active_support/notifications/fanout.rb

Instance Attribute Summary

Attributes inherited from Evented

#pattern

Instance Method Summary collapse

Methods inherited from Evented

#initialize, #matches?, #publish, #subscribed_to?, #unsubscribe!

Constructor Details

This class inherits a constructor from ActiveSupport::Notifications::Fanout::Subscribers::Evented

Instance Method Details

#finish(name, id, payload) ⇒ Object



215
216
217
218
219
220
221
# File 'lib/active_support/notifications/fanout.rb', line 215

def finish(name, id, payload)
  stack = Thread.current[:_event_stack]
  event = stack.pop
  event.payload = payload
  event.finish!
  @delegate.call event
end

#start(name, id, payload) ⇒ Object



208
209
210
211
212
213
# File 'lib/active_support/notifications/fanout.rb', line 208

def start(name, id, payload)
  stack = Thread.current[:_event_stack] ||= []
  event = build_event name, id, payload
  event.start!
  stack.push event
end