Class: Bidi2pdf::Notifications::Instrumenter
- Inherits:
-
Object
- Object
- Bidi2pdf::Notifications::Instrumenter
- Defined in:
- lib/bidi2pdf/notifications/instrumenter.rb
Instance Attribute Summary collapse
-
#id ⇒ Object
readonly
Returns the value of attribute id.
Instance Method Summary collapse
-
#initialize ⇒ Instrumenter
constructor
A new instance of Instrumenter.
- #notify(name, payload) ⇒ Object
Constructor Details
#initialize ⇒ Instrumenter
Returns a new instance of Instrumenter.
17 18 19 |
# File 'lib/bidi2pdf/notifications/instrumenter.rb', line 17 def initialize @id = SecureRandom.uuid end |
Instance Attribute Details
#id ⇒ Object (readonly)
Returns the value of attribute id.
15 16 17 |
# File 'lib/bidi2pdf/notifications/instrumenter.rb', line 15 def id @id end |
Instance Method Details
#notify(name, payload) ⇒ Object
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/bidi2pdf/notifications/instrumenter.rb', line 21 def notify(name, payload, &) event = create_event(name, payload) result = nil begin result = event.record(&) rescue Exception => e end subscriber_exceptions = notify_subscribers(name, event) raise Bidi2pdf::NotificationsError.new(subscriber_exceptions), cause: subscriber_exceptions.first if subscriber_exceptions.any? raise e if e result end |