diff options
Diffstat (limited to 'lib/custodian/queue.rb')
-rw-r--r-- | lib/custodian/queue.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/custodian/queue.rb b/lib/custodian/queue.rb index bb67c8e..89266df 100644 --- a/lib/custodian/queue.rb +++ b/lib/custodian/queue.rb @@ -96,7 +96,7 @@ module Custodian loop do - _foo, job = @redis.blpop('queue', :timeout => timeout) + job = @redis.spop('queue') if job return job @@ -112,7 +112,7 @@ module Custodian # Add a new job to the queue. # def add(job_string) - @redis.rpush('queue', job_string) + @redis.sadd('queue', job_string) end @@ -120,7 +120,7 @@ module Custodian # How many jobs in the queue? # def size? - @redis.llen('queue') + @redis.scard('queue') end |