Class: Eventboss::SnsClient

Inherits:
Object
  • Object
show all
Defined in:
lib/eventboss/sns_client.rb

Defined Under Namespace

Classes: Mock

Instance Method Summary collapse

Constructor Details

#initialize(configuration) ⇒ SnsClient

Returns a new instance of SnsClient.



8
9
10
# File 'lib/eventboss/sns_client.rb', line 8

def initialize(configuration)
  @configuration = configuration
end

Instance Method Details

#create_subscription(topic_arn:, queue_arn:) ⇒ Object



20
21
22
23
24
25
26
27
# File 'lib/eventboss/sns_client.rb', line 20

def create_subscription(topic_arn:, queue_arn:)
  subscription = backend.subscribe(
    topic_arn: topic_arn,
    endpoint: queue_arn,
    protocol: 'sqs'
  )
  set_raw_message_delivery(subscription)
end

#create_topic(name:) ⇒ Object



16
17
18
# File 'lib/eventboss/sns_client.rb', line 16

def create_topic(name:)
  backend.create_topic(name: name)
end

#publish(payload) ⇒ Object



12
13
14
# File 'lib/eventboss/sns_client.rb', line 12

def publish(payload)
  backend.publish(payload)
end