def inner(name): queue.use(name) queue.watch(name) while True: job = queue.reserve(timeout=1) if job is None: break job.delete()
def add(queue, args): name = optdict.get('-q') if name: queue.use(name) funcname = optdict.get('-f', 'main') for url in args: queue.put(httputils.ReqInfo(funcname, url).pack()) print 'put:', url