1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Update CHANGELOG and docs

with change to ActiveSupport::Notifications::Instrumenter#instrument
This commit is contained in:
Ali Ibrahim 2019-03-22 11:17:33 -04:00
parent 1b7ef40db5
commit aaf89cdea7
2 changed files with 11 additions and 3 deletions

View file

@ -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:

View file

@ -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