2007-09-15 | paulb | raw annotate files changeset graph | [project @ 2007-09-15 19:41:09 by paulb] Made the Map class more usable as a result collector with the usual Exchange methods and managed callables, rather than being called itself and directly providing a result. Added iterator and list-style access through Map objects, rather than returning the results list to a caller. |
1 #!/usr/bin/env python 2 3 from pprocess import create 4 5 limit = 100 6 channel = create() 7 if channel.pid == 0: 8 i = channel.receive() 9 while i < limit: 10 print i 11 i = channel.receive() 12 channel.send("Done") 13 else: 14 for i in range(0, limit + 1): 15 channel.send(i) 16 print channel.receive() 17 18 # vim: tabstop=4 expandtab shiftwidth=4