aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport
diff options
context:
space:
mode:
authorAli Ibrahim <aibrahim2k2@gmail.com>2019-03-22 11:17:33 -0400
committerAli Ibrahim <aibrahim2k2@gmail.com>2019-03-22 11:17:33 -0400
commitaaf89cdea7105ae7789483cec2d786cfa1cef7f9 (patch)
tree66cdf7cdfbee89d2cb351e357ab1cf8b9e65d7ec /activesupport
parent1b7ef40db5ed06b655a624ce56c80fb91b683885 (diff)
downloadrails-aaf89cdea7105ae7789483cec2d786cfa1cef7f9.tar.gz
rails-aaf89cdea7105ae7789483cec2d786cfa1cef7f9.tar.bz2
rails-aaf89cdea7105ae7789483cec2d786cfa1cef7f9.zip
Update CHANGELOG and docs
with change to ActiveSupport::Notifications::Instrumenter#instrument
Diffstat (limited to 'activesupport')
-rw-r--r--activesupport/CHANGELOG.md7
-rw-r--r--activesupport/lib/active_support/notifications/instrumenter.rb7
2 files changed, 11 insertions, 3 deletions
diff --git a/activesupport/CHANGELOG.md b/activesupport/CHANGELOG.md
index 63e2e44597..3d63420efd 100644
--- a/activesupport/CHANGELOG.md
+++ b/activesupport/CHANGELOG.md
@@ -1,3 +1,10 @@
+* Update `ActiveSupport::Notifications::Instrumenter#instrument to make
+ passing a block optional. This will let users use
+ `ActiveSupport::Notifications` messaging features outside of
+ instrumentation.
+
+ *Ali Ibrahim*
+
* Fix `Time#advance` to work with dates before 1001-03-07
Before:
diff --git a/activesupport/lib/active_support/notifications/instrumenter.rb b/activesupport/lib/active_support/notifications/instrumenter.rb
index d4e1f3ca6f..a03e7e483e 100644
--- a/activesupport/lib/active_support/notifications/instrumenter.rb
+++ b/activesupport/lib/active_support/notifications/instrumenter.rb
@@ -13,9 +13,10 @@ module ActiveSupport
@notifier = notifier
end
- # Instrument the given block by measuring the time taken to execute it
- # and publish it. Notice that events get sent even if an error occurs
- # in the passed-in block.
+ # Given a block, instrument it by measuring the time taken to execute
+ # and publish it. Without a block, simply send a message via the
+ # notifier. Notice that events get sent even if an error occurs in the
+ # passed-in block.
def instrument(name, payload = {})
# some of the listeners might have state
listeners_state = start name, payload