Package Ganga :: Package Utility :: Package AMGAServerTools :: Module PipeReader :: Class PipeReader
[hide private]
[frames] | no frames]

Class PipeReader

source code

Instance Methods [hide private]
 
__init__(self, readfile, timeout=None, pipesize=0, blocksize=1024)
Initialise a non-blocking pipe object, given a real file readfile.
source code
 
__del__(self) source code
 
stop(self) source code
 
_readtoq(self) source code
 
has_data(self) source code
 
isReading(self) source code
 
instantRead(self, maxblocks=0)
Read data from the queue, to a maximum of maxblocks (0 = infinite).
source code
 
read(self, maxblocks=0, timeout=None, condition=None)
Read data from the queue, allowing timeout seconds between block arrival.
source code
Method Details [hide private]

__init__(self, readfile, timeout=None, pipesize=0, blocksize=1024)
(Constructor)

source code 
Initialise a non-blocking pipe object, given a real file readfile.
timeout = the default timeout (in seconds) at which read will decide
          that there is no more data in the queue.
          timeout = None, or < 0 stands for indefinite waiting time. 
pipesize = the size (in blocks) of the queue used to buffer the
          blocks read
blocksize = the maximum block size for a raw read.

instantRead(self, maxblocks=0)

source code 

Read data from the queue, to a maximum of maxblocks (0 = infinite). Does not block.

read(self, maxblocks=0, timeout=None, condition=None)

source code 

Read data from the queue, allowing timeout seconds between block arrival. if timeout = None, then use default timeout. If timeout<0, then wait indefinitely. Returns '' if we are at the EOF, or no data turns up within the timeout. If condition is not None and condition() == False returns. Reads at most maxblocks (0 = infinite). Does not block.