1.1 --- a/examples/concurrency-sig/bottles.py Wed Jun 10 00:06:01 2009 +0200
1.2 +++ b/examples/concurrency-sig/bottles.py Sat Jun 13 20:37:50 2009 +0200
1.3 @@ -35,9 +35,11 @@
1.4 def multigrep(ch, pattern):
1.5 queue = pprocess.Queue(continuous=1)
1.6 multifollow = queue.manage(follow)
1.7 - multifollow('test') # '/var/log/system.log'
1.8 - multifollow('test2')
1.9 - multifollow('test3')
1.10 +
1.11 + # Launch concurrent following activities.
1.12 + multifollow('/tmp/test') # '/var/log/system.log'
1.13 + multifollow('/tmp/test2')
1.14 + multifollow('/tmp/test3')
1.15
1.16 # Handle incoming lines using the specified pattern.
1.17 grep(ch, queue, pattern)
1.18 @@ -45,10 +47,13 @@
1.19 # Permit multiple simultaneous grep activities.
1.20 queue = pprocess.Queue(continuous=1)
1.21 multigrep = queue.manage(multigrep)
1.22 +
1.23 +# Launch concurrent grep activities.
1.24 multigrep(".*pants.*")
1.25 multigrep(".*trousers.*")
1.26 multigrep(".*shorts.*")
1.27
1.28 +# Print incoming lines.
1.29 p = printer(queue)
1.30
1.31 # vim: tabstop=4 expandtab shiftwidth=4
2.1 --- a/examples/concurrency-sig/bottles_heartbeat.py Wed Jun 10 00:06:01 2009 +0200
2.2 +++ b/examples/concurrency-sig/bottles_heartbeat.py Sat Jun 13 20:37:50 2009 +0200
2.3 @@ -40,9 +40,11 @@
2.4 def multigrep(ch, pattern):
2.5 queue = pprocess.Queue(continuous=1)
2.6 multifollow = queue.manage(follow)
2.7 - multifollow('test') # '/var/log/system.log'
2.8 - multifollow('test2')
2.9 - multifollow('test3')
2.10 +
2.11 + # Launch concurrent following activities.
2.12 + multifollow('/tmp/test') # '/var/log/system.log'
2.13 + multifollow('/tmp/test2')
2.14 + multifollow('/tmp/test3')
2.15
2.16 # Handle incoming lines using the specified pattern.
2.17 grep(ch, queue, pattern)
2.18 @@ -50,10 +52,13 @@
2.19 # Permit multiple simultaneous grep activities.
2.20 queue = pprocess.Queue(continuous=1)
2.21 multigrep = queue.manage(multigrep)
2.22 +
2.23 +# Launch concurrent grep activities.
2.24 multigrep(".*pants.*")
2.25 multigrep(".*trousers.*")
2.26 multigrep(".*shorts.*")
2.27
2.28 +# Print incoming lines.
2.29 p = printer(queue)
2.30
2.31 # vim: tabstop=4 expandtab shiftwidth=4