Back to index

moin  1.9.0~rc2
Public Member Functions | Private Member Functions | Private Attributes
MoinMoin.support.flup.server.fcgi_base.MultiplexedInputStream Class Reference
Inheritance diagram for MoinMoin.support.flup.server.fcgi_base.MultiplexedInputStream:
Inheritance graph
[legend]
Collaboration diagram for MoinMoin.support.flup.server.fcgi_base.MultiplexedInputStream:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def __init__
def read
def readline
def add_data
def readlines
def __iter__
def next

Private Member Functions

def _waitForData

Private Attributes

 _lock

Detailed Description

A version of InputStream meant to be used with MultiplexedConnections.
Assumes the MultiplexedConnection (the producer) and the Request
(the consumer) are running in different threads.

Definition at line 234 of file fcgi_base.py.


Constructor & Destructor Documentation

Reimplemented from MoinMoin.support.flup.server.fcgi_base.InputStream.

Definition at line 240 of file fcgi_base.py.

00240 
00241     def __init__(self, conn):
00242         super(MultiplexedInputStream, self).__init__(conn)
00243 
00244         # Arbitrates access to this InputStream (it's used simultaneously
00245         # by a Request and its owning Connection object).
00246         lock = threading.RLock()
00247 
00248         # Notifies Request thread that there is new data available.
00249         self._lock = threading.Condition(lock)


Member Function Documentation

Definition at line 218 of file fcgi_base.py.

00218 
00219     def __iter__(self):
00220         return self

Waits for more data to become available.

Reimplemented from MoinMoin.support.flup.server.fcgi_base.InputStream.

Definition at line 250 of file fcgi_base.py.

00250 
00251     def _waitForData(self):
00252         # Wait for notification from add_data().
00253         self._lock.wait()

Reimplemented from MoinMoin.support.flup.server.fcgi_base.InputStream.

Definition at line 268 of file fcgi_base.py.

00268 
00269     def add_data(self, data):
00270         self._lock.acquire()
00271         try:
00272             super(MultiplexedInputStream, self).add_data(data)
00273             self._lock.notify()
00274         finally:
00275             self._lock.release()

Definition at line 221 of file fcgi_base.py.

00221 
00222     def next(self):
00223         r = self.readline()
00224         if not r:
00225             raise StopIteration
00226         return r

Here is the call graph for this function:

Here is the caller graph for this function:

Reimplemented from MoinMoin.support.flup.server.fcgi_base.InputStream.

Definition at line 254 of file fcgi_base.py.

00254 
00255     def read(self, n=-1):
00256         self._lock.acquire()
00257         try:
00258             return super(MultiplexedInputStream, self).read(n)
00259         finally:
00260             self._lock.release()

Here is the caller graph for this function:

Reimplemented from MoinMoin.support.flup.server.fcgi_base.InputStream.

Definition at line 261 of file fcgi_base.py.

00261 
00262     def readline(self, length=None):
00263         self._lock.acquire()
00264         try:
00265             return super(MultiplexedInputStream, self).readline(length)
00266         finally:
00267             self._lock.release()

Here is the caller graph for this function:

def MoinMoin.support.flup.server.fcgi_base.InputStream.readlines (   self,
  sizehint = 0 
) [inherited]

Definition at line 206 of file fcgi_base.py.

00206 
00207     def readlines(self, sizehint=0):
00208         total = 0
00209         lines = []
00210         line = self.readline()
00211         while line:
00212             lines.append(line)
00213             total += len(line)
00214             if 0 < sizehint <= total:
00215                 break
00216             line = self.readline()
00217         return lines

Here is the call graph for this function:


Member Data Documentation

Definition at line 248 of file fcgi_base.py.


The documentation for this class was generated from the following file: