lib/cloud_powers/synapse/broadcast/broadcast.rb in cloud_powers-0.2.7.1 vs lib/cloud_powers/synapse/broadcast/broadcast.rb in cloud_powers-0.2.7.2

- old
+ new

@@ -27,10 +27,11 @@ end end # end Channel ################# # Creates a connection point for 1..N nodes to create a connection with the Broadcast + # <b>Not Implimented</b> # # Parameters # * channel +String+ # # Notes @@ -58,20 +59,22 @@ def delete_channel!(channel) sns.delete_topic(topic_arn: channel.arn) end # Creates a connection to the Broadcast so that new messages will be picked up + # # Parameters channel <Broadcast::Channel> def listen_on(channel) sns.subscribe( topic_arn: channel.arn, protocol: 'application', endpoint: channel.endpoint ) end # Lists the created topics in SNS. + # # Returns results <Array def real_channels results = [] next_token = '' loop do @@ -82,12 +85,16 @@ end results end # Send a message to a Channel using SNS#publish - # Parameters [opts <Hash>]: - # this includes all the keys AWS uses but for now it only has defaults + # + # Parameters + # * opts +Hash+ - this includes all the keys AWS uses but for now it only has defaults # for topic_arn and the message + # * * +:topic_arn+ - the ARN for the topic in AWS + # * * +:message+ - the message that should be broadcasted to whoever is listening on this + # Channel (AWS Topic) def send_broadcast(opts = {}) msg = opts.delete(:message) || "" package = { topic_arn: "topicARN",