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

Returns true if the job was queued, nil if the job was rejected by a before_enqueue hook.

This method is considered part of the stable API.



218
219
220
# File 'lib/resque.rb', line 218

def enqueue(klass, *args)
  enqueue_to(queue_from_class(klass), klass, *args)
end