郁闷了有半天了,不想多说了
#! usr/bin/env python
#encoding=utf8
from dreque import Dreque, DrequeWorker
import time
a=Dreque("127.0.0.1", db=None)
a=Dreque(("127.0.0.1",6379),db=10)
a.redis.flushdb()
def some_job(argument):
time.sleep(1)
print argument
for i in xrange(100):
a.enqueue("queue", some_job, argument=i)
print "done!"
worker = DrequeWorker(["queue"],("127.0.0.1",6379),db=10)
worker.work()