class method self.monotonic_subscribe

Ruby on Rails edge

Since v6.1.7.10

Available in: v6.1.7.10 v7.0.10 v7.1.6 v7.2.3.2 v8.0.5.1 v8.1.3.1 edge

Signature

self.monotonic_subscribe(pattern = nil, callback = nil, prepend: false, &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 Daylight Savings). Use monotonic_subscribe when accuracy of time duration is important. For example, computing elapsed time between two events.

Parameters

pattern opt = nil
callback opt = nil
prepend key = false
block block
Source
# File activesupport/lib/active_support/notifications.rb, line 325
      def monotonic_subscribe(pattern = nil, callback = nil, prepend: false, &block)
        subscriber = notifier.subscribe(pattern, callback, monotonic: true, prepend: prepend, &block)
        record_subscriptions

        subscriber
      end

Defined in activesupport/lib/active_support/notifications.rb line 325 · View on GitHub · Improve this page · Find usages on GitHub

Defined in ActiveSupport::Notifications

Type at least 2 characters to search.

Use the arrow keys to navigate results, Enter to open one, Escape to close.

Keyboard shortcuts

/
Focus search
⌘K / Ctrl-K
Command palette
?
This help
Esc
Close