Chatwoot/app/dispatchers/async_dispatcher.rb
Subin T P ed1c871633
Feature: Slack integration (#783)
- Integrations architecture
- Slack integration
2020-06-12 23:12:47 +05:30

15 lines
459 B
Ruby

class AsyncDispatcher < BaseDispatcher
def dispatch(event_name, timestamp, data)
EventDispatcherJob.perform_later(event_name, timestamp, data)
end
def publish_event(event_name, timestamp, data)
event_object = Events::Base.new(event_name, timestamp, data)
publish(event_object.method_name, event_object)
end
def listeners
listeners = [EventListener.instance, WebhookListener.instance, HookListener.instance]
listeners
end
end