Method: Resque#enqueue
- Defined in:
- lib/resque.rb
#enqueue(klass, *args) ⇒ Object
This method can be used to conveniently add a job to a queue. It assumes the class you’re passing it is a real Ruby class (not a string or reference) which either:
a) has a @queue ivar set
b) responds to `queue`
If either of those conditions are met, it will use the value obtained from performing one of the above operations to determine the queue.
If no queue can be inferred this method will raise a Resque::NoQueueError
This method is considered part of the stable API.
186 187 188 |
# File 'lib/resque.rb', line 186 def enqueue(klass, *args) Job.create(queue_from_class(klass), klass, *args) end |