Class: Refried::Configuration
- Inherits:
-
Object
- Object
- Refried::Configuration
- Defined in:
- lib/refried/configuration.rb
Overview
The Refried Configuration class
based in general on the configuration approach in https://github.com/nesquena/backburner MIT license
Constant Summary collapse
- PRIORITY_LABELS =
{ :high => 0, :medium => 100, :low => 200 }
Instance Attribute Summary collapse
-
#beanstalk_url ⇒ Object
beanstalk url connection.
-
#default_priority ⇒ Object
default job priority.
-
#logger ⇒ Object
logger.
-
#max_job_retries ⇒ Object
max job retries.
-
#on_error ⇒ Object
error handler.
-
#priority_labels ⇒ Object
priority labels.
-
#reserve_timeout ⇒ Object
duration to wait to reserve on a single server.
-
#respond_timeout ⇒ Object
default job timeout.
-
#retry_delay ⇒ Object
retry delay in seconds.
-
#tube_namespace ⇒ Object
namespace prefix for every queue.
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/refried/configuration.rb', line 18 def initialize @beanstalk_url = "beanstalk://localhost" @tube_namespace = "refried.queue" @default_priority = 65536 @respond_timeout = 120 @on_error = nil @max_job_retries = 0 @retry_delay = 5 @logger = nil @priority_labels = PRIORITY_LABELS @reserve_timeout = nil end |
Instance Attribute Details
#beanstalk_url ⇒ Object
beanstalk url connection
7 8 9 |
# File 'lib/refried/configuration.rb', line 7 def beanstalk_url @beanstalk_url end |
#default_priority ⇒ Object
default job priority
9 10 11 |
# File 'lib/refried/configuration.rb', line 9 def default_priority @default_priority end |
#logger ⇒ Object
logger
14 15 16 |
# File 'lib/refried/configuration.rb', line 14 def logger @logger end |
#max_job_retries ⇒ Object
max job retries
12 13 14 |
# File 'lib/refried/configuration.rb', line 12 def max_job_retries @max_job_retries end |
#on_error ⇒ Object
error handler
11 12 13 |
# File 'lib/refried/configuration.rb', line 11 def on_error @on_error end |
#priority_labels ⇒ Object
priority labels
15 16 17 |
# File 'lib/refried/configuration.rb', line 15 def priority_labels @priority_labels end |
#reserve_timeout ⇒ Object
duration to wait to reserve on a single server
16 17 18 |
# File 'lib/refried/configuration.rb', line 16 def reserve_timeout @reserve_timeout end |
#respond_timeout ⇒ Object
default job timeout
10 11 12 |
# File 'lib/refried/configuration.rb', line 10 def respond_timeout @respond_timeout end |
#retry_delay ⇒ Object
retry delay in seconds
13 14 15 |
# File 'lib/refried/configuration.rb', line 13 def retry_delay @retry_delay end |
#tube_namespace ⇒ Object
namespace prefix for every queue
8 9 10 |
# File 'lib/refried/configuration.rb', line 8 def tube_namespace @tube_namespace end |