Class: FruitJuice::DelayedJob
- Inherits:
-
Object
- Object
- FruitJuice::DelayedJob
- Defined in:
- lib/fruit_juice/delayed_job.rb
Instance Attribute Summary collapse
-
#job_type ⇒ Object
readonly
Returns the value of attribute job_type.
-
#waiting_queue_key ⇒ Object
readonly
Returns the value of attribute waiting_queue_key.
Instance Method Summary collapse
-
#initialize(**config_options) ⇒ DelayedJob
constructor
A new instance of DelayedJob.
- #perform(**job_options) ⇒ Object
Constructor Details
#initialize(**config_options) ⇒ DelayedJob
Returns a new instance of DelayedJob.
13 14 15 16 17 18 19 |
# File 'lib/fruit_juice/delayed_job.rb', line 13 def initialize(**) raise "job_type must be a string" if .has_key?(:job_type) && [:job_type].class != String @redis_adapter = set_redis_adapter([:redis_adapter]) @job_type = set_job_type([:job_type]) @waiting_queue_key = "mosquito:waiting:#{@job_type.underscore}" end |
Instance Attribute Details
#job_type ⇒ Object (readonly)
Returns the value of attribute job_type.
11 12 13 |
# File 'lib/fruit_juice/delayed_job.rb', line 11 def job_type @job_type end |
#waiting_queue_key ⇒ Object (readonly)
Returns the value of attribute waiting_queue_key.
11 12 13 |
# File 'lib/fruit_juice/delayed_job.rb', line 11 def waiting_queue_key @waiting_queue_key end |
Instance Method Details
#perform(**job_options) ⇒ Object
21 22 23 24 |
# File 'lib/fruit_juice/delayed_job.rb', line 21 def perform(**) @job_options = .deep_stringify_keys! enqueue_job end |