class method
self.monotonic_subscribe
Ruby on Rails 7.0.10
Since v6.1.7.10Signature
self.monotonic_subscribe(pattern = nil, callback = nil, &block)
Performs the same functionality as #subscribe, but the start and finish block arguments are in monotonic time instead of wall-clock time. Monotonic time will not jump forward or backward (due to NTP or Daylights Savings). Use monotonic_subscribe when accuracy of time duration is important. For example, computing elapsed time between two events.
Parameters
-
patternopt = nil -
callbackopt = nil -
blockblock
Source
# File activesupport/lib/active_support/notifications.rb, line 253
def monotonic_subscribe(pattern = nil, callback = nil, &block)
notifier.subscribe(pattern, callback, monotonic: true, &block)
end
Defined in activesupport/lib/active_support/notifications.rb line 253
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveSupport::Notifications