class BetterSqs::Queue

A Class for interacting with an SQS queue as an OOP style entity

Constants

QUEUE_ATTRIBUTES

Attributes

better_client[RW]
queue_name[RW]

Public Class Methods

new(better_client, queue_name) click to toggle source
# File lib/better_sqs/queue.rb, line 8
def initialize(better_client, queue_name)
  @better_client = better_client
  @queue_name = queue_name
end

Public Instance Methods

push(message_body) click to toggle source

Push a message onto a queue

@param message_body [String] the message as it will be pushed onto the queue, no serialization occurs as

part of this method. You need to encode or serialize your object to a string before sending it to this method

@return [Types::SendMessageResult] the sent message object returned from s3

# File lib/better_sqs/queue.rb, line 18
def push(message_body)
  better_client.push queue_name, message_body
end
reserve() click to toggle source

Reserve a message from the specified queue

@return [Messages::Sqs, NilClass] the message retrieved from the queue

# File lib/better_sqs/queue.rb, line 25
def reserve
  better_client.reserve queue_name
end