def worker(jobs):
    while True:
        yield jobs.get().addCallback(async)

def main():
    jobs = DeferredQueue()
for i in range(10):
    jobs.put(i)
assign(jobs)
for i in range(3):
    cooperate(worker(jobs))
reactor.run()
if __name__ == '__main__':
    main()
Queue remote calls to a Python Twisted perspective broker?