Class: MandrillQueue::Adapters::ResqueAdapter
- Inherits:
-
Object
- Object
- MandrillQueue::Adapters::ResqueAdapter
- Defined in:
- lib/mandrill_queue/adapters/resque_adapter.rb
Instance Method Summary collapse
Instance Method Details
#check_for_scheduler! ⇒ Object
16 17 18 19 |
# File 'lib/mandrill_queue/adapters/resque_adapter.rb', line 16 def check_for_scheduler! raise RuntimeError, "Please install resque-scheduler to allow scheduled jobs!" \ unless ::Resque.respond_to?(:enqueue_in) end |
#enqueue_to(queue, klass, options, *args) ⇒ Object
4 5 6 7 8 9 10 11 12 13 14 |
# File 'lib/mandrill_queue/adapters/resque_adapter.rb', line 4 def enqueue_to(queue, klass, , *args) if .key?(:send_at) check_for_scheduler! Resque.enqueue_at_with_queue(queue, [:send_at], klass, *args) elsif .key?(:send_in) check_for_scheduler! Resque.enqueue_in_with_queue(queue, [:send_in], klass, *args) else ::Resque.enqueue_to(queue, klass, *args) end end |