Class: ActiveSupport::Notifications::Fanout::Subscribers::Timed

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

Overview

:nodoc:

Instance Method Summary collapse

Methods inherited from Evented

#initialize, #matches?, #subscribed_to?

Constructor Details

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

Instance Method Details

#finish(name, id, payload) ⇒ Object



126
127
128
129
130
# File 'lib/active_support/notifications/fanout.rb', line 126

def finish(name, id, payload)
  timestack = Thread.current[:_timestack]
  started = timestack.pop
  @delegate.call(name, started, Time.now, id, payload)
end

#publish(name, *args) ⇒ Object



117
118
119
# File 'lib/active_support/notifications/fanout.rb', line 117

def publish(name, *args)
  @delegate.call name, *args
end

#start(name, id, payload) ⇒ Object



121
122
123
124
# File 'lib/active_support/notifications/fanout.rb', line 121

def start(name, id, payload)
  timestack = Thread.current[:_timestack] ||= []
  timestack.push Time.now
end