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

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

Overview

:nodoc:

Instance Attribute Summary

Attributes inherited from Evented

#pattern

Instance Method Summary collapse

Methods inherited from Evented

#initialize, #publish_event, #subscribed_to?, #unsubscribe!

Constructor Details

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

Instance Method Details

#finish(name, id, payload) ⇒ Object


238
239
240
241
242
# File 'activesupport/lib/active_support/notifications/fanout.rb', line 238

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

#publish(name, *args) ⇒ Object


229
230
231
# File 'activesupport/lib/active_support/notifications/fanout.rb', line 229

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

#start(name, id, payload) ⇒ Object


233
234
235
236
# File 'activesupport/lib/active_support/notifications/fanout.rb', line 233

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