class DispatchRider::NotificationServices::AwsSns

Public Instance Methods

channel(name) click to toggle source

not really happy with this, but the notification service registrar system is way too rigid to do this cleaner since you only can have one notifier for the whole service, but you need to create a new one for each region

# File lib/dispatch-rider/notification_services/aws_sns.rb, line 24
def channel(name)
  arn = self.fetch(name)
  region = arn.split(':')[3]
  notifier_builder.new(region: region).topics[arn]
end
channel_registrar_builder() click to toggle source
# File lib/dispatch-rider/notification_services/aws_sns.rb, line 14
def channel_registrar_builder
  Registrars::SnsChannel
end
notifier_builder() click to toggle source
# File lib/dispatch-rider/notification_services/aws_sns.rb, line 8
def notifier_builder
  AWS::SNS
rescue NameError
  raise AdapterNotFoundError.new(self.class.name, 'aws-sdk')
end
publish_to_channel(channel, message:) click to toggle source
Calls superclass method
# File lib/dispatch-rider/notification_services/aws_sns.rb, line 18
def publish_to_channel(channel, message:)
  Retriable.retriable(tries: 10, on: AWS::Errors::MissingCredentialsError) { super }
end