Class: QPush::Config
- Inherits:
-
Object
- Object
- QPush::Config
- Defined in:
- lib/qpush/config.rb
Constant Summary collapse
- DEFAULTS =
{ redis_url: ENV['REDIS_URL'], database_url: ENV['DATABASE_URL'], redis_pool: 10, database_pool: 10, workers: 2, stats_namespace: 'qpush:v1:stats', queue_threads: 2, queue_namespace: 'qpush:v1:queue', perform_threads: 2, perform_namespace: 'qpush:v1:perform', delay_threads:1, delay_namespace: 'qpush:v1:delay', priorities: 5 }.freeze
Instance Attribute Summary collapse
-
#database_adapter ⇒ Object
Returns the value of attribute database_adapter.
-
#database_pool ⇒ Object
Returns the value of attribute database_pool.
-
#database_url ⇒ Object
Returns the value of attribute database_url.
-
#delay_namespace ⇒ Object
Returns the value of attribute delay_namespace.
-
#delay_threads ⇒ Object
Returns the value of attribute delay_threads.
-
#perform_namespace ⇒ Object
Returns the value of attribute perform_namespace.
-
#perform_threads ⇒ Object
Returns the value of attribute perform_threads.
-
#priorities ⇒ Object
Returns the value of attribute priorities.
-
#queue_namespace ⇒ Object
Returns the value of attribute queue_namespace.
-
#queue_threads ⇒ Object
Returns the value of attribute queue_threads.
-
#redis_pool ⇒ Object
Returns the value of attribute redis_pool.
-
#redis_url ⇒ Object
Returns the value of attribute redis_url.
-
#stats_namespace ⇒ Object
Returns the value of attribute stats_namespace.
-
#workers ⇒ Object
Returns the value of attribute workers.
Instance Method Summary collapse
-
#initialize ⇒ Config
constructor
A new instance of Config.
- #manager_options ⇒ Object
- #perform_lists ⇒ Object
- #redis ⇒ Object
- #worker_options ⇒ Object
Constructor Details
Instance Attribute Details
#database_adapter ⇒ Object
Returns the value of attribute database_adapter.
35 36 37 |
# File 'lib/qpush/config.rb', line 35 def database_adapter @database_adapter end |
#database_pool ⇒ Object
Returns the value of attribute database_pool.
35 36 37 |
# File 'lib/qpush/config.rb', line 35 def database_pool @database_pool end |
#database_url ⇒ Object
Returns the value of attribute database_url.
35 36 37 |
# File 'lib/qpush/config.rb', line 35 def database_url @database_url end |
#delay_namespace ⇒ Object
Returns the value of attribute delay_namespace.
35 36 37 |
# File 'lib/qpush/config.rb', line 35 def delay_namespace @delay_namespace end |
#delay_threads ⇒ Object
Returns the value of attribute delay_threads.
35 36 37 |
# File 'lib/qpush/config.rb', line 35 def delay_threads @delay_threads end |
#perform_namespace ⇒ Object
Returns the value of attribute perform_namespace.
35 36 37 |
# File 'lib/qpush/config.rb', line 35 def perform_namespace @perform_namespace end |
#perform_threads ⇒ Object
Returns the value of attribute perform_threads.
35 36 37 |
# File 'lib/qpush/config.rb', line 35 def perform_threads @perform_threads end |
#priorities ⇒ Object
Returns the value of attribute priorities.
35 36 37 |
# File 'lib/qpush/config.rb', line 35 def priorities @priorities end |
#queue_namespace ⇒ Object
Returns the value of attribute queue_namespace.
35 36 37 |
# File 'lib/qpush/config.rb', line 35 def queue_namespace @queue_namespace end |
#queue_threads ⇒ Object
Returns the value of attribute queue_threads.
35 36 37 |
# File 'lib/qpush/config.rb', line 35 def queue_threads @queue_threads end |
#redis_pool ⇒ Object
Returns the value of attribute redis_pool.
35 36 37 |
# File 'lib/qpush/config.rb', line 35 def redis_pool @redis_pool end |
#redis_url ⇒ Object
Returns the value of attribute redis_url.
35 36 37 |
# File 'lib/qpush/config.rb', line 35 def redis_url @redis_url end |
#stats_namespace ⇒ Object
Returns the value of attribute stats_namespace.
35 36 37 |
# File 'lib/qpush/config.rb', line 35 def stats_namespace @stats_namespace end |
#workers ⇒ Object
Returns the value of attribute workers.
35 36 37 |
# File 'lib/qpush/config.rb', line 35 def workers @workers end |
Instance Method Details
#manager_options ⇒ Object
52 53 54 55 56 57 |
# File 'lib/qpush/config.rb', line 52 def { workers: workers, options: } end |
#perform_lists ⇒ Object
66 67 68 |
# File 'lib/qpush/config.rb', line 66 def perform_lists (1..priorities).collect { |num| "#{perform_namespace}:#{num}" } end |
#redis ⇒ Object
59 60 61 62 63 64 |
# File 'lib/qpush/config.rb', line 59 def redis { size: redis_pool, url: redis_url } end |
#worker_options ⇒ Object
44 45 46 47 48 49 50 |
# File 'lib/qpush/config.rb', line 44 def { perform_threads: perform_threads, queue_threads: queue_threads, delay_threads: delay_threads } end |