1.1 --- a/parallel.py Wed Sep 28 16:24:06 2005 +0000
1.2 +++ b/parallel.py Wed Sep 28 17:08:36 2005 +0000
1.3 @@ -57,6 +57,12 @@
1.4
1.5 exchange = Exchange(channels)
1.6
1.7 +To test whether an exchange is active - that is, whether it is actually
1.8 +monitoring any channels - we can use the active method which returns all
1.9 +channels being monitored by the exchange:
1.10 +
1.11 +channels = exchange.active()
1.12 +
1.13 We may then check the exchange to see whether any data is ready to be received;
1.14 for example:
1.15
1.16 @@ -89,6 +95,8 @@
1.17 http://twistedmatrix.com/pipermail/twisted-python/2005-February/009666.html
1.18 """
1.19
1.20 +__version__ = "0.1"
1.21 +
1.22 import os
1.23 import sys
1.24 import select
1.25 @@ -179,9 +187,9 @@
1.26
1.27 def active(self):
1.28
1.29 - "Return the number of active channels."
1.30 + "Return a list of active channels."
1.31
1.32 - return len(self.readables.keys())
1.33 + return self.readables.values()
1.34
1.35 def ready(self, timeout=None):
1.36