Permalink
Browse files

example-project: added a note about FIFO/LIFO post processing of items.

  • Loading branch information...
1 parent 88929bf commit 31b16a9cae16153c828749885090c4a4cfef5e4e @rmax committed Feb 17, 2013
Showing with 2 additions and 1 deletion.
  1. +2 −1 example-project/process_items.py
@@ -7,7 +7,8 @@
def main():
r = redis.Redis()
while True:
- source, data = r.brpop(["dmoz:items"])
+ # 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

0 comments on commit 31b16a9

Please sign in to comment.