def worker(queue):
    while 1:
        url = yield queue.get()
if url is None:
    queue.put(None)
return
data = yield download(url)
process(data)
queue = DeferredQueue()
MAX = 20
workers = [worker(queue) for _ in range(MAX)]
Downloading files in twisted using queue