Class: Soda::Worker::Options
- Inherits:
-
Object
- Object
- Soda::Worker::Options
- Defined in:
- lib/soda/worker.rb
Instance Method Summary collapse
-
#initialize(klass, options) ⇒ Options
constructor
A new instance of Options.
- #perform_async(*args) ⇒ Object
- #perform_in(delay, *args) ⇒ Object (also: #perform_at)
- #set(opts = {}) ⇒ Object
Constructor Details
#initialize(klass, options) ⇒ Options
Returns a new instance of Options.
4 5 6 7 |
# File 'lib/soda/worker.rb', line 4 def initialize(klass, ) @klass = klass @options = end |
Instance Method Details
#perform_async(*args) ⇒ Object
15 16 17 |
# File 'lib/soda/worker.rb', line 15 def perform_async(*args) perform_in(0, *args) end |
#perform_in(delay, *args) ⇒ Object Also known as: perform_at
19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/soda/worker.rb', line 19 def perform_in(delay, *args) tap do client = Soda::Client.new client.push( .merge( "delay" => delay, "klass" => klass, "args" => args, ), ) end end |
#set(opts = {}) ⇒ Object
9 10 11 12 13 |
# File 'lib/soda/worker.rb', line 9 def set(opts = {}) tap do .merge!(opts) end end |