Class: TResque::DelayExecutionWorker
- Inherits:
-
Object
- Object
- TResque::DelayExecutionWorker
- Extended by:
- QueueLock, WorkerLock
- Includes:
- Worker
- Defined in:
- lib/tresque/delay_execution_worker.rb
Instance Attribute Summary
Attributes included from Worker
Class Method Summary collapse
-
.get_lock_namespace(options) ⇒ Object
handle dynamic locks.
- .get_queue_lock_attributes(options) ⇒ Object
- .get_worker_lock_attributes(options) ⇒ Object
Instance Method Summary collapse
Methods included from WorkerLock
around_perform_worker_lock, before_perform_worker_lock, clear_worker_lock, on_failure_worker_lock, worker_lock_timeout
Methods included from QueueLock
after_dequeue_queue_lock, before_enqueue_queue_lock, before_perform_queue_lock, clear_queue_lock, queue_lock_timeout
Methods included from Worker
#initialize, #requeue, #requeue!, #requeue_delay_seconds, #worker_perform
Class Method Details
.get_lock_namespace(options) ⇒ Object
handle dynamic locks
12 13 14 |
# File 'lib/tresque/delay_execution_worker.rb', line 12 def get_lock_namespace() ["lock_namespace"] || ["class_name"] end |
.get_queue_lock_attributes(options) ⇒ Object
16 17 18 19 |
# File 'lib/tresque/delay_execution_worker.rb', line 16 def get_queue_lock_attributes() return nil unless ["queue_lock"] [["queue_lock"]].flatten end |
.get_worker_lock_attributes(options) ⇒ Object
21 22 23 24 |
# File 'lib/tresque/delay_execution_worker.rb', line 21 def get_worker_lock_attributes() return nil unless ["worker_lock"] [["worker_lock"]].flatten end |
Instance Method Details
#work ⇒ Object
27 28 29 30 31 32 33 34 |
# File 'lib/tresque/delay_execution_worker.rb', line 27 def work return unless record if args.nil? || args.empty? record.send(self.method_name) else record.send(self.method_name, *self.args) end end |