ruby on rails - How resque removes job from the queue? -
i have implemented resque queuing system in rails app. want know flow of resque job starting enqueue removed out queue.
the traditional work flow, along method used gem is,
1. resque enqueue job(resque::job.create) ,
2. job calls 'perform' method of class(resque::job.perform), and
3. resque removes job queue.
i debugged gem find out method used in step 3, couldn't find it. methods resque::job.destroy, resque::job.dequeue not responsible task, debugged. can tell me method using remove job queue
.
please note that, not want remove job explicitly, want typical resque method removes job queue.
thanks in advance.
resque uses 'dequeue' method remove job:
def dequeue(klass, *args) job.destroy(queue_from_class(klass), klass, *args) end
to pick job queue processing uses 'pop' method:
def pop(queue) decode redis.lpop("queue:#{queue}") end
Comments
Post a Comment