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

Inherits:
Evented
  • Object
show all
Defined in:
activesupport/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



219
220
221
222
223
224
225
# File 'activesupport/lib/active_support/notifications/fanout.rb', line 219

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



212
213
214
215
216
217
# File 'activesupport/lib/active_support/notifications/fanout.rb', line 212

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