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



201
202
203
204
205
206
# File 'lib/active_support/notifications/fanout.rb', line 201

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

#start(name, id, payload) ⇒ Object



194
195
196
197
198
199
# File 'lib/active_support/notifications/fanout.rb', line 194

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