Class: Qless::RecurringJob
Instance Attribute Summary collapse
-
#count ⇒ Object
readonly
Returns the value of attribute count.
-
#data ⇒ Object
Returns the value of attribute data.
-
#interval ⇒ Object
Returns the value of attribute interval.
-
#jid ⇒ Object
readonly
Returns the value of attribute jid.
-
#klass_name ⇒ Object
readonly
Returns the value of attribute klass_name.
-
#priority ⇒ Object
Returns the value of attribute priority.
-
#queue_name ⇒ Object
readonly
Returns the value of attribute queue_name.
-
#retries ⇒ Object
Returns the value of attribute retries.
-
#tags ⇒ Object
readonly
Returns the value of attribute tags.
Attributes inherited from BaseJob
Instance Method Summary collapse
- #cancel ⇒ Object
-
#initialize(client, atts) ⇒ RecurringJob
constructor
A new instance of RecurringJob.
- #klass=(value) ⇒ Object
- #move(queue) ⇒ Object
- #tag(*tags) ⇒ Object
- #untag(*tags) ⇒ Object
Methods inherited from BaseJob
Constructor Details
#initialize(client, atts) ⇒ RecurringJob
Returns a new instance of RecurringJob.
313 314 315 316 317 318 319 320 321 322 |
# File 'lib/qless/job.rb', line 313 def initialize(client, atts) super(client, atts.fetch('jid')) %w{jid data priority tags retries interval count}.each do |att| self.instance_variable_set("@#{att}".to_sym, atts.fetch(att)) end @klass_name = atts.fetch('klass') @queue_name = atts.fetch('queue') = [] if == {} end |
Instance Attribute Details
#count ⇒ Object (readonly)
Returns the value of attribute count.
311 312 313 |
# File 'lib/qless/job.rb', line 311 def count @count end |
#data ⇒ Object
Returns the value of attribute data.
311 312 313 |
# File 'lib/qless/job.rb', line 311 def data @data end |
#interval ⇒ Object
Returns the value of attribute interval.
311 312 313 |
# File 'lib/qless/job.rb', line 311 def interval @interval end |
#jid ⇒ Object (readonly)
Returns the value of attribute jid.
311 312 313 |
# File 'lib/qless/job.rb', line 311 def jid @jid end |
#klass_name ⇒ Object (readonly)
Returns the value of attribute klass_name.
311 312 313 |
# File 'lib/qless/job.rb', line 311 def klass_name @klass_name end |
#priority ⇒ Object
Returns the value of attribute priority.
311 312 313 |
# File 'lib/qless/job.rb', line 311 def priority @priority end |
#queue_name ⇒ Object (readonly)
Returns the value of attribute queue_name.
311 312 313 |
# File 'lib/qless/job.rb', line 311 def queue_name @queue_name end |
#retries ⇒ Object
Returns the value of attribute retries.
311 312 313 |
# File 'lib/qless/job.rb', line 311 def retries @retries end |
#tags ⇒ Object (readonly)
Returns the value of attribute tags.
311 312 313 |
# File 'lib/qless/job.rb', line 311 def end |
Instance Method Details
#cancel ⇒ Object
354 355 356 |
# File 'lib/qless/job.rb', line 354 def cancel @client._recur.call([], ['off', @jid]) end |
#klass=(value) ⇒ Object
344 345 346 347 |
# File 'lib/qless/job.rb', line 344 def klass=(value) @client._recur.call([], ['update', @jid, 'klass', value.to_s]) @klass_name = value.to_s end |
#move(queue) ⇒ Object
349 350 351 352 |
# File 'lib/qless/job.rb', line 349 def move(queue) @client._recur.call([], ['update', @jid, 'queue', queue]) @queue_name = queue end |
#tag(*tags) ⇒ Object
358 359 360 |
# File 'lib/qless/job.rb', line 358 def tag(*) @client._recur.call([], ['tag', @jid] + ) end |
#untag(*tags) ⇒ Object
362 363 364 |
# File 'lib/qless/job.rb', line 362 def untag(*) @client._recur.call([], ['untag', @jid] + ) end |