2019-08-14 09:48:44 +00:00
|
|
|
class AsyncDispatcher < BaseDispatcher
|
|
|
|
def dispatch(event_name, timestamp, data)
|
|
|
|
event_object = Events::Base.new(event_name, timestamp, data)
|
2020-03-18 11:23:35 +00:00
|
|
|
# TODO: Move this to worker
|
2019-08-14 09:48:44 +00:00
|
|
|
publish(event_object.method_name, event_object)
|
|
|
|
end
|
|
|
|
|
|
|
|
def listeners
|
2020-03-05 20:13:12 +00:00
|
|
|
listeners = [AgentBotListener.instance, EmailNotificationListener.instance, ReportingListener.instance, WebhookListener.instance]
|
2020-03-18 11:23:35 +00:00
|
|
|
listeners << EventListener.instance
|
2019-11-24 13:39:17 +00:00
|
|
|
listeners << SubscriptionListener.instance if ENV['BILLING_ENABLED']
|
|
|
|
listeners
|
2019-08-14 09:48:44 +00:00
|
|
|
end
|
|
|
|
end
|