# HG changeset patch # User mcroydon # Date 1256076072 0 # Node ID b4184f99ed13cd84246c6e00d06e3c3f36f6a922 # Parent b2af7123f5e3ba15edaf165063ca3aebc90ac0e2 Added functionality for the dummy backend to make it behave more like a production backend for testability sake. Thanks to Travis Cline for the patch. Fixes issue #4. diff -r b2af7123f5e3 -r b4184f99ed13 queues/backends/dummy.py --- a/queues/backends/dummy.py Wed Sep 16 15:03:15 2009 +0000 +++ b/queues/backends/dummy.py Tue Oct 20 22:01:12 2009 +0000 @@ -7,13 +7,16 @@ from queues import QueueException from queues.backends.base import BaseQueue +queues = {} -dummy_queue = queue.Queue() - +def get_queue(name): + if name not in queues: + queues[name] = queue.Queue() + return queues[name] class Queue(BaseQueue): def __init__(self, name='default'): - self.queue = dummy_queue + self.queue = get_queue(name) self.backend = 'dummy' self.name = name