Class: EventEngine::Subscribers::DispatchSubscribersJob
- Inherits:
-
ApplicationJob
- Object
- ActiveJob::Base
- ApplicationJob
- EventEngine::Subscribers::DispatchSubscribersJob
- Defined in:
- app/jobs/event_engine/subscribers/dispatch_subscribers_job.rb
Overview
Runs an event's subscribers in a background worker. Enqueued by
Processor for :background events, which dispatch their subscribers
asynchronously without touching the outbox.
Instance Method Summary collapse
Instance Method Details
#perform(event_name, attrs) ⇒ void
This method returns an undefined value.
12 13 14 15 |
# File 'app/jobs/event_engine/subscribers/dispatch_subscribers_job.rb', line 12 def perform(event_name, attrs) event = EventEngine::Event.new(**attrs.deep_symbolize_keys) Registry.subscribers_for(event_name).each { |subscriber| subscriber.new.handle(event) } end |