Class: WebhookSystem::Dispatcher

Inherits:
Object
  • Object
show all
Defined in:
lib/webhook_system/dispatcher.rb

Overview

Main code that handles dispatching of events out to subscribers

Class Method Summary collapse

Class Method Details

.dispatch(event) ⇒ Object

Parameters:



8
9
10
11
12
# File 'lib/webhook_system/dispatcher.rb', line 8

def dispatch(event)
  WebhookSystem::Subscription.interested_in_topic(event.event_name).each do |subscription|
    WebhookSystem::Job.perform_later subscription, event.as_json
  end
end