Class: CloudwatchScheduler::Configuration
- Inherits:
-
Object
- Object
- CloudwatchScheduler::Configuration
- Defined in:
- lib/cloudwatch_scheduler/configuration.rb
Instance Attribute Summary collapse
-
#queue_max_receive_count ⇒ Object
Returns the value of attribute queue_max_receive_count.
- #queue_name ⇒ Object
-
#queue_visibility_timeout ⇒ Object
Returns the value of attribute queue_visibility_timeout.
-
#tasks ⇒ Object
readonly
Returns the value of attribute tasks.
-
#use_dead_letter_queue ⇒ Object
Returns the value of attribute use_dead_letter_queue.
Instance Method Summary collapse
- #configure(&config) ⇒ Object
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #set_defaults ⇒ Object
- #task(name, **kwargs, &task) ⇒ Object
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
13 14 15 16 |
# File 'lib/cloudwatch_scheduler/configuration.rb', line 13 def initialize @tasks = {} set_defaults end |
Instance Attribute Details
#queue_max_receive_count ⇒ Object
Returns the value of attribute queue_max_receive_count.
7 8 9 |
# File 'lib/cloudwatch_scheduler/configuration.rb', line 7 def queue_max_receive_count @queue_max_receive_count end |
#queue_name ⇒ Object
35 36 37 |
# File 'lib/cloudwatch_scheduler/configuration.rb', line 35 def queue_name @queue_name ||= CloudwatchScheduler::Job.queue_name end |
#queue_visibility_timeout ⇒ Object
Returns the value of attribute queue_visibility_timeout.
7 8 9 |
# File 'lib/cloudwatch_scheduler/configuration.rb', line 7 def queue_visibility_timeout @queue_visibility_timeout end |
#tasks ⇒ Object (readonly)
Returns the value of attribute tasks.
11 12 13 |
# File 'lib/cloudwatch_scheduler/configuration.rb', line 11 def tasks @tasks end |
#use_dead_letter_queue ⇒ Object
Returns the value of attribute use_dead_letter_queue.
7 8 9 |
# File 'lib/cloudwatch_scheduler/configuration.rb', line 7 def use_dead_letter_queue @use_dead_letter_queue end |
Instance Method Details
#configure(&config) ⇒ Object
18 19 20 21 |
# File 'lib/cloudwatch_scheduler/configuration.rb', line 18 def configure(&config) instance_exec(self, &config) self end |
#set_defaults ⇒ Object
27 28 29 30 31 |
# File 'lib/cloudwatch_scheduler/configuration.rb', line 27 def set_defaults @queue_visibility_timeout = 1.minute @queue_max_receive_count = 2 @use_dead_letter_queue = true end |