Class: ActiveSupport::Notifications::Fanout::Subscribers::MonotonicTimed

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


255
256
257
258
259
# File 'activesupport/lib/active_support/notifications/fanout.rb', line 255

def finish(name, id, payload)
  timestack = IsolatedExecutionState[:_timestack_monotonic]
  started = timestack.pop
  @delegate.call(name, started, Process.clock_gettime(Process::CLOCK_MONOTONIC), id, payload)
end

#publish(name, *args) ⇒ Object


246
247
248
# File 'activesupport/lib/active_support/notifications/fanout.rb', line 246

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

#start(name, id, payload) ⇒ Object


250
251
252
253
# File 'activesupport/lib/active_support/notifications/fanout.rb', line 250

def start(name, id, payload)
  timestack = IsolatedExecutionState[:_timestack_monotonic] ||= []
  timestack.push Process.clock_gettime(Process::CLOCK_MONOTONIC)
end