Class: Smash::CloudPowers::Synapse::Queue::Poller

Inherits:
Resource
  • Object
show all
Defined in:
lib/cloud_powers/synapse/queue/poller.rb

Overview

The Queue::Resource class helps wrap up information and functionality of a Queue on SQS. It is basically just an abstraction to make using SQS simpler

Instance Attribute Summary collapse

Attributes inherited from Resource

#call_name, #client, #linked, #meta, #name, #remote_id, #tags, #type

Instance Method Summary collapse

Methods included from Zenv

#env_vars, #i_vars, #lsof_cwd, #pid, #proc_cwd, #process_search, #project_root, #project_root=, #ps_cwd, #system_vars, #zfind, #zselect

Methods included from Helpers

#create_logger, #log_file, #logger

Methods included from PathHelp

#common_delimiter, #expand_path, #file_exists?, #file_search, #filename?, #job_exist?, #job_path, #job_require_path, #path_search, #paths_gcd, #paths_lcd, #to_path, #to_pathname, #to_realpath, #touch, #zlib_path

Methods included from LogicHelp

#attr_map, #called_from, #i_var_hash, #instance_attr_accessor, #smart_retry, #update_message_body, #wait_until

Methods included from LangHelp

#deep_modify_keys_with, #extract!, #find_and_remove, #format_error_message, #from_json, #modify_keys_with, #to_basic_hash, #to_camel, #to_hyph, #to_i_var, #to_pascal, #to_ruby_file_name, #to_snake, #valid_json?, #valid_url?

Methods included from AwsResources

#ec2, #image, #kinesis, #queue_poller, #region, #s3, #sns

Methods included from Auth

creds, region

Methods included from Creatable

included

Constructor Details

#initialize(name:, client: sqs, **config) ⇒ Poller

Returns a new instance of Poller.



16
17
18
19
20
# File 'lib/cloud_powers/synapse/queue/poller.rb', line 16

def initialize(name:, client: sqs, **config)
  super
  @sqs = client
  @call_name = queue_poller_name(name)
end

Instance Attribute Details

#sqsObject

Returns the value of attribute sqs.



14
15
16
# File 'lib/cloud_powers/synapse/queue/poller.rb', line 14

def sqs
  @sqs
end

Instance Method Details

#create_resourceObject



22
23
24
# File 'lib/cloud_powers/synapse/queue/poller.rb', line 22

def create_resource
  @response = queue_poller(queue_url: address, client: sqs)
end