Back to index

python3.2  3.2.2
Public Member Functions | Public Attributes | Private Attributes
test.test_multiprocessing._file_like Class Reference
Inheritance diagram for test.test_multiprocessing._file_like:
Inheritance graph
[legend]
Collaboration diagram for test.test_multiprocessing._file_like:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def __init__
def cache
def write
def flush

Public Attributes

_PyObject_HEAD_EXTRA Py_ssize_t ob_refcnt
struct _typeobjectob_type

Private Attributes

 _delegate
 _pid
 _cache

Detailed Description

Definition at line 2095 of file test_multiprocessing.py.


Constructor & Destructor Documentation

def test.test_multiprocessing._file_like.__init__ (   self,
  delegate 
)

Definition at line 2096 of file test_multiprocessing.py.

02096 
02097     def __init__(self, delegate):
02098         self._delegate = delegate
02099         self._pid = None

Here is the caller graph for this function:


Member Function Documentation

Definition at line 2101 of file test_multiprocessing.py.

02101 
02102     def cache(self):
02103         pid = os.getpid()
02104         # There are no race conditions since fork keeps only the running thread
02105         if pid != self._pid:
02106             self._pid = pid
02107             self._cache = []
02108         return self._cache

Here is the caller graph for this function:

Definition at line 2112 of file test_multiprocessing.py.

02112 
02113     def flush(self):
02114         self._delegate.write(''.join(self.cache))
02115         self._cache = []

Here is the call graph for this function:

Here is the caller graph for this function:

def test.test_multiprocessing._file_like.write (   self,
  data 
)

Definition at line 2109 of file test_multiprocessing.py.

02109 
02110     def write(self, data):
02111         self.cache.append(data)


Member Data Documentation

Definition at line 2106 of file test_multiprocessing.py.

Definition at line 2097 of file test_multiprocessing.py.

Definition at line 2098 of file test_multiprocessing.py.

Definition at line 107 of file object.h.

struct _typeobject* _object::ob_type [inherited]

Definition at line 108 of file object.h.


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