module Artsy::EventService

Constants

VERSION

Public Class Methods

config() click to toggle source
# File lib/artsy-eventservice/config.rb, line 39
def config
  Config
end
configure() { |Config| ... } click to toggle source
# File lib/artsy-eventservice/config.rb, line 34
def configure
  yield(Config) if block_given?
  Config
end
consume(**args) click to toggle source
# File lib/artsy-eventservice/artsy/event_service.rb, line 17
def self.consume(**args)
  raise 'Not implemented- try Sneakers'
end
event_stream_enabled?() click to toggle source
# File lib/artsy-eventservice/artsy/event_service.rb, line 21
def self.event_stream_enabled?
  Artsy::EventService.config.event_stream_enabled
end
post_data(topic:, data:, routing_key: nil) click to toggle source

Post data without an event, data must be a string.

# File lib/artsy-eventservice/artsy/event_service.rb, line 7
def self.post_data(topic:, data:, routing_key: nil)
  return unless event_stream_enabled?
  Publisher.publish_data(topic: topic, data: data, routing_key: routing_key)
end
post_event(topic:, event:, routing_key: nil) click to toggle source
# File lib/artsy-eventservice/artsy/event_service.rb, line 12
def self.post_event(topic:, event:, routing_key: nil)
  return unless event_stream_enabled?
  Publisher.publish_event(topic: topic, event: event, routing_key: routing_key || event.routing_key)
end