Class: LiveQA::AsyncHandlers::Sidekiq
- Includes:
- Sidekiq::Worker
- Defined in:
- lib/liveqa/async_handlers/sidekiq.rb
Constant Summary collapse
- OPTIONS =
{ 'queue' => 'liveqa', 'class' => self }.freeze
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Instance Method Summary collapse
- #enqueue(*args) ⇒ Object
-
#initialize(options = {}) ⇒ Sidekiq
constructor
A new instance of Sidekiq.
- #perform(*args) ⇒ Object
Methods inherited from Base
Constructor Details
#initialize(options = {}) ⇒ Sidekiq
Returns a new instance of Sidekiq.
15 16 17 18 19 |
# File 'lib/liveqa/async_handlers/sidekiq.rb', line 15 def initialize( = {}) = OPTIONS.merge( Util.deep_stringify_key() ) end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
13 14 15 |
# File 'lib/liveqa/async_handlers/sidekiq.rb', line 13 def end |
Instance Method Details
#enqueue(*args) ⇒ Object
21 22 23 24 25 |
# File 'lib/liveqa/async_handlers/sidekiq.rb', line 21 def enqueue(*args) ::Sidekiq::Client.push( .merge('args' => args) ) end |
#perform(*args) ⇒ Object
27 28 29 |
# File 'lib/liveqa/async_handlers/sidekiq.rb', line 27 def perform(*args) execute(args) end |