Class: EventQ::Amazon::QueueClient
- Inherits:
-
Object
- Object
- EventQ::Amazon::QueueClient
- Defined in:
- lib/eventq/eventq_aws/aws_queue_client.rb
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ QueueClient
constructor
A new instance of QueueClient.
-
#sns(region = nil) ⇒ Object
Returns the AWS SNS Client.
- #sns_helper(region = nil) ⇒ Object
-
#sqs(region = nil) ⇒ Object
Returns the AWS SQS Client.
- #sqs_helper(region = nil) ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ QueueClient
Returns a new instance of QueueClient.
6 7 8 9 10 11 12 |
# File 'lib/eventq/eventq_aws/aws_queue_client.rb', line 6 def initialize( = {}) invalid_keys = .keys - %i[sns_keep_alive_timeout sns_continue_timeout] raise(OptionParser::InvalidOption, invalid_keys) unless invalid_keys.empty? @sns_keep_alive_timeout = [:sns_keep_alive_timeout] || 30 @sns_continue_timeout = [:sns_continue_timeout] || 15 end |
Instance Method Details
#sns(region = nil) ⇒ Object
Returns the AWS SNS Client
24 25 26 27 28 29 30 |
# File 'lib/eventq/eventq_aws/aws_queue_client.rb', line 24 def sns(region = nil) if region.nil? @sns ||= sns_client else sns_client(region) end end |
#sns_helper(region = nil) ⇒ Object
40 41 42 43 44 45 46 |
# File 'lib/eventq/eventq_aws/aws_queue_client.rb', line 40 def sns_helper(region = nil) if region.nil? @sns_helper ||= Amazon::SNS.new(sns) else Amazon::SNS.new(sns_client(region)) end end |
#sqs(region = nil) ⇒ Object
Returns the AWS SQS Client
15 16 17 18 19 20 21 |
# File 'lib/eventq/eventq_aws/aws_queue_client.rb', line 15 def sqs(region = nil) if region.nil? @sqs ||= sqs_client else sqs_client(region) end end |