def main():
    r = redis.Redis()
    while True:
        # process queue as FIFO, change `blpop` to `brpop` to process as LIFO
        source, data = r.blpop(["dmoz:items"])
        item = json.loads(data)
        try:
            print u"Processing: %(name)s <%(link)s>" % item
        except __HOLE__:
            print u"Error procesing: %r" % item
dataset/ETHPy150Open rolando/scrapy-redis/example-project/process_items.py/main