Package pymeterlib :: Module pyssh_nbpipe :: Class nbpipe
[show private | hide private]
[frames | no frames]

Class nbpipe


Method Summary
  __init__(self, readfile, timeout, pipesize, blocksize)
Initialise a non-blocking pipe object, given a real file or file-descriptor.
  _readtoq(self)
  eof(self)
  has_data(self)
  read_all(self)
Read until the EOF.
  read_lazy(self, maxblocks, timeout)
Read data from the queue, allowing timeout seconds between block arrival.
  read_some(self, maxblocks, timeout)
As for read_lazy, but always read a single block of data.
  read_very_lazy(self, maxblocks)
Read data from the queue, to a maximum of maxblocks (0 = infinite).

Method Details

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

Initialise a non-blocking pipe object, given a real file or file-descriptor. timeout = the default timeout (in seconds) at which read_lazy will decide that there is no more data in this read pipesize = the size (in blocks) of the queue used to buffer the blocks read blocksize = the maximum block size for a raw read.

read_all(self)

Read until the EOF. May block.

read_lazy(self, maxblocks=0, timeout=None)

Read data from the queue, allowing timeout seconds between block arrival. if timeout = None, then use the objects (default) timeout. Returns '' if we are at the EOF, or no data turns up within the timeout. Reads at most maxblocks (0 = infinite). Does not block.

read_some(self, maxblocks=0, timeout=None)

As for read_lazy, but always read a single block of data. May block.

read_very_lazy(self, maxblocks=0)

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

Generated by Epydoc 2.1 on Fri Mar 17 09:16:19 2006 http://epydoc.sf.net