2009-06-05 | Paul Boddie | raw annotate files changeset graph | Added support for continuous communications in the Exchange class, tidying various methods and adding new methods for monitoring the state of active channels and waiting tasks. Added a timeout method to the Exchange.store method. Added an example of timeouts and continuous communications. Updated release notes and some of the documentation. |
1 #!/usr/bin/env python 2 3 from pprocess import start 4 5 def loop(channel, limit): 6 print "loop to", limit 7 i = channel.receive() 8 while i < limit: 9 print i 10 i = channel.receive() 11 channel.send("Done") 12 13 if __name__ == "__main__": 14 limit = 100 15 channel = start(loop, limit) 16 for i in range(0, limit + 1): 17 channel.send(i) 18 print channel.receive() 19 20 # vim: tabstop=4 expandtab shiftwidth=4