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

Popular posts from this blog

linux - Mailx and Gmail nss config dir -

c# - Is it possible to remove an existing registration from Autofac container builder? -

php - Mysql PK and FK char(36) vs int(10) -