Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

worker can attach to a queue

  • Loading branch information...
commit c0a71377bad4c550f9c4278100b38cf86f0f2526 1 parent a93da63
Ryan R. Smith authored
Showing with 3 additions and 2 deletions.
  1. +3 −2 lib/queue_classic/worker.rb
View
5 lib/queue_classic/worker.rb
@@ -3,6 +3,7 @@ class Worker
def initialize
@running = true
+ @queue = QC::Queue.new(ENV["QUEUE"])
handle_signals
end
@@ -29,13 +30,13 @@ def start
end
def work
- if job = QC.dequeue #blocks until we have a job
+ if job = @queue.dequeue #blocks until we have a job
begin
job.work
rescue Object => e
handle_failure(job,e)
ensure
- QC.delete(job)
+ @queue.delete(job)
end
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.