Home | Trees | Index | Help |
---|
Module pprocess :: Class Exchange |
|
A communications exchange that can be used to detect channels which are ready to communicate. Subclasses of this class can define the 'store_data' method in order to enable the 'add_wait', 'wait' and 'finish' methods.
Method Summary | |
---|---|
Initialise the exchange with an optional list of 'channels'. | |
Return a list of active channels. | |
Add the given 'channel' to the exchange. | |
Add the given 'channel' to the exchange, waiting if the limit on active channels would be exceeded by adding the channel. | |
Finish the use of the exchange by waiting for all channels to complete. | |
Wait for a period of time specified by the optional 'timeout' (or until communication is possible) and return a list of channels which are ready to be read from. | |
Remove the given 'channel' from the exchange. | |
For each ready channel, process the incoming data. | |
Store incoming data from the specified 'channel'. | |
Test for the limit on channels, blocking and reading incoming data until the number of channels is below the limit. |
Method Details |
---|
__init__(self,
channels=None,
limit=None,
autoclose=1)
|
active(self)Return a list of active channels. |
add(self, channel)Add the given 'channel' to the exchange. |
add_wait(self, channel)Add the given 'channel' to the exchange, waiting if the limit on active channels would be exceeded by adding the channel. |
finish(self)Finish the use of the exchange by waiting for all channels to complete. |
ready(self, timeout=None)Wait for a period of time specified by the optional 'timeout' (or until communication is possible) and return a list of channels which are ready to be read from. |
remove(self, channel)Remove the given 'channel' from the exchange. |
store(self)For each ready channel, process the incoming data. |
store_data(self, channel)Store incoming data from the specified 'channel'. In subclasses of this class, such data could be stored using instance attributes. |
wait(self)Test for the limit on channels, blocking and reading incoming data until the number of channels is below the limit. |
Home | Trees | Index | Help |
---|
Generated by Epydoc 2.1 on Thu Mar 29 01:54:07 2007 | http://epydoc.sf.net |