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, #matches?, #subscribed_to?, #unsubscribe!

Constructor Details

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

Instance Method Details

#finish(name, id, payload) ⇒ Object



204
205
206
207
208
# File 'activesupport/lib/active_support/notifications/fanout.rb', line 204

def finish(name, id, payload)
  timestack = Thread.current[:_timestack_monotonic]
  started = timestack.pop
  @delegate.call(name, started, Concurrent.monotonic_time, id, payload)
end

#publish(name, *args) ⇒ Object



195
196
197
# File 'activesupport/lib/active_support/notifications/fanout.rb', line 195

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

#start(name, id, payload) ⇒ Object



199
200
201
202
# File 'activesupport/lib/active_support/notifications/fanout.rb', line 199

def start(name, id, payload)
  timestack = Thread.current[:_timestack_monotonic] ||= []
  timestack.push Concurrent.monotonic_time
end