Created
April 21, 2012 13:30
-
-
Save sfate/2437079 to your computer and use it in GitHub Desktop.
intro Amazon SQS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'right_aws' | |
# aws credits | |
aws_access_key = { | |
:id => "your key goes here", | |
:secret => "your secret access key goes here" | |
} | |
# initialize new connection to amazon sqs broker | |
sqs = RightAws::SqsGen2.new(aws_access_key[:id], aws_access_key[:secret]) | |
# initialize queue | |
q = sqs.queue("queue_name") | |
# this will serialize and submit the message Yo! | |
# to your queue named "queue_name" | |
q.push("Yo!") | |
# this will pop a message off of the queue named "queue_name" | |
returned_msg = q.pop | |
# will remove the message from the queue | |
returned_msg.delete |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment