FsQueueElastic queue based on filesystem | |
Download |
FsQueue Ranking & Summary
Advertisement
- License:
- Python License
- Publisher Name:
- FUKUDA Masahiro
- Publisher web site:
- http://fukuda.org
FsQueue Tags
FsQueue Description
Elastic queue based on filesystem FsQueue is an elastic synchronized queue Python class.A quick example:example:import sysfrom multiprocessing import Processfrom FsQueue import Queuefrom time import sleepdef put(q, num): for i in xrange(num): print "put:%d" % i sys.stdout.flush() q.put(i)def get(q, num): for i in xrange(num): sys.stdout.flush() print "get:%d %d" % (i, q.get()) q.task_done()def process_test(): q = Queue(init=True) p0 = Process(target=put, args=(q,1000)) p0.start() p0.join() p1 = Process(target=get, args=(q,500)) p2 = Process(target=get, args=(q,500)) p1.start() p2.start() p1.join() p2.join() if not q.empty(): print "Queue should be empty." raise Exceptionif __name__ == '__main__': process_test()
FsQueue Related Software