2007-12-02 | paulb | file changeset files shortlog | [project @ 2007-12-02 22:53:47 by paulb] Fixed URL. |
paulb@1 | 1 | #!/usr/bin/env python |
paulb@1 | 2 | |
paulb@40 | 3 | from pprocess import start |
paulb@1 | 4 | |
paulb@1 | 5 | def loop(channel, limit): |
paulb@1 | 6 | print "loop to", limit |
paulb@1 | 7 | i = channel.receive() |
paulb@1 | 8 | while i < limit: |
paulb@1 | 9 | print i |
paulb@1 | 10 | i = channel.receive() |
paulb@1 | 11 | channel.send("Done") |
paulb@1 | 12 | |
paulb@1 | 13 | if __name__ == "__main__": |
paulb@1 | 14 | limit = 100 |
paulb@1 | 15 | channel = start(loop, limit) |
paulb@1 | 16 | for i in range(0, limit + 1): |
paulb@1 | 17 | channel.send(i) |
paulb@1 | 18 | print channel.receive() |
paulb@1 | 19 | |
paulb@1 | 20 | # vim: tabstop=4 expandtab shiftwidth=4 |