All Downloads are FREE. Search and download functionalities are using the official Maven repository.

backbone.aws.AmazonSnsOps.scala Maven / Gradle / Ivy

The newest version!
package backbone.aws

import backbone.scaladsl.Backbone.QueueInformation
import com.amazonaws.services.sns.AmazonSNSAsync
import com.amazonaws.services.sns.model.{SubscribeRequest, SubscribeResult}

import scala.concurrent.{ExecutionContext, Future}

private[backbone] trait AmazonSnsOps extends AmazonAsync {

  def sns: AmazonSNSAsync

  def subscribe(queue: QueueInformation, topicArn: String)(implicit ec: ExecutionContext): Future[Unit] = {
    async[SubscribeRequest, SubscribeResult](sns.subscribeAsync(topicArn, "sqs", queue.arn, _)).map(_ => ())
  }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy