instance method
emit_event
Ruby on Rails 8.1.2
Since v8.1.2Signature
emit_event(name, payload = nil, caller_depth: 1, **kwargs)
Emit a structured event via Rails.event.notify.
Arguments
-
name- The event name as a string or symbol -
payload- The event payload as a hash or object -
caller_depth- Stack depth for source location (default: 1) -
kwargs- Additional payload data merged with the payload hash
Parameters
-
namereq -
payloadopt = nil -
caller_depthkey = 1 -
kwargskeyrest
Source
# File activesupport/lib/active_support/structured_event_subscriber.rb, line 75
def emit_event(name, payload = nil, caller_depth: 1, **kwargs)
ActiveSupport.event_reporter.notify(name, payload, caller_depth: caller_depth + 1, **kwargs)
rescue => e
handle_event_error(name, e)
end
Defined in activesupport/lib/active_support/structured_event_subscriber.rb line 75
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveSupport::StructuredEventSubscriber