Back to index

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

List of all members.

Public Member Functions

def __init__
def run
def submit
def stop
def start
def terminate
def join
def is_alive
def name
def name
def daemon
def daemon
def authkey
def authkey
def exitcode
def ident
def __repr__

Public Attributes

 parent_conn
_PyObject_HEAD_EXTRA Py_ssize_t ob_refcnt
struct _typeobjectob_type

Static Public Attributes

 pid = ident

Detailed Description

Definition at line 302 of file test_multiprocessing.py.


Constructor & Destructor Documentation

Definition at line 304 of file test_multiprocessing.py.

00304 
00305     def __init__(self):
00306         multiprocessing.Process.__init__(self)
00307         self.child_conn, self.parent_conn = multiprocessing.Pipe()

Here is the caller graph for this function:


Member Function Documentation

def multiprocessing.process.Process.__repr__ (   self) [inherited]

Definition at line 219 of file process.py.

00219 
00220     def __repr__(self):
00221         if self is _current_process:
00222             status = 'started'
00223         elif self._parent_pid != os.getpid():
00224             status = 'unknown'
00225         elif self._popen is None:
00226             status = 'initial'
00227         else:
00228             if self._popen.poll() is not None:
00229                 status = self.exitcode
00230             else:
00231                 status = 'started'
00232 
00233         if type(status) is int:
00234             if status == 0:
00235                 status = 'stopped'
00236             else:
00237                 status = 'stopped[%s]' % _exitcode_to_name.get(status, status)
00238 
00239         return '<%s(%s, %s%s)>' % (type(self).__name__, self._name,
00240                                    status, self._daemonic and ' daemon' or '')

Here is the call graph for this function:

def multiprocessing.process.Process.authkey (   self) [inherited]

Definition at line 188 of file process.py.

00188 
00189     def authkey(self):
00190         return self._authkey

Here is the caller graph for this function:

def multiprocessing.process.Process.authkey (   self,
  authkey 
) [inherited]
Set authorization key of process

Definition at line 192 of file process.py.

00192 
00193     def authkey(self, authkey):
00194         '''
00195         Set authorization key of process
00196         '''
00197         self._authkey = AuthenticationString(authkey)

Here is the call graph for this function:

def multiprocessing.process.Process.daemon (   self) [inherited]
Return whether process is a daemon

Definition at line 173 of file process.py.

00173 
00174     def daemon(self):
00175         '''
00176         Return whether process is a daemon
00177         '''
00178         return self._daemonic

Here is the caller graph for this function:

def multiprocessing.process.Process.daemon (   self,
  daemonic 
) [inherited]
Set whether process is a daemon

Definition at line 180 of file process.py.

00180 
00181     def daemon(self, daemonic):
00182         '''
00183         Set whether process is a daemon
00184         '''
00185         assert self._popen is None, 'process has already started'
00186         self._daemonic = daemonic

Here is the call graph for this function:

def multiprocessing.process.Process.exitcode (   self) [inherited]
Return exit code of process or `None` if it has yet to stop

Definition at line 199 of file process.py.

00199 
00200     def exitcode(self):
00201         '''
00202         Return exit code of process or `None` if it has yet to stop
00203         '''
00204         if self._popen is None:
00205             return self._popen
00206         return self._popen.poll()

Here is the caller graph for this function:

def multiprocessing.process.Process.ident (   self) [inherited]
Return identifier (PID) of process or `None` if it has yet to start

Definition at line 208 of file process.py.

00208 
00209     def ident(self):
00210         '''
00211         Return identifier (PID) of process or `None` if it has yet to start
00212         '''
00213         if self is _current_process:
00214             return os.getpid()
00215         else:
00216             return self._popen and self._popen.pid

def multiprocessing.process.Process.is_alive (   self) [inherited]
Return whether process is alive

Definition at line 151 of file process.py.

00151 
00152     def is_alive(self):
00153         '''
00154         Return whether process is alive
00155         '''
00156         if self is _current_process:
00157             return True
00158         assert self._parent_pid == os.getpid(), 'can only test a child process'
00159         if self._popen is None:
00160             return False
00161         self._popen.poll()
00162         return self._popen.returncode is None

Here is the caller graph for this function:

def multiprocessing.process.Process.join (   self,
  timeout = None 
) [inherited]
Wait until child process terminates

Definition at line 141 of file process.py.

00141 
00142     def join(self, timeout=None):
00143         '''
00144         Wait until child process terminates
00145         '''
00146         assert self._parent_pid == os.getpid(), 'can only join a child process'
00147         assert self._popen is not None, 'can only join a started process'
00148         res = self._popen.wait(timeout)
00149         if res is not None:
00150             _current_process._children.discard(self)

Here is the caller graph for this function:

def multiprocessing.process.Process.name (   self) [inherited]

Definition at line 164 of file process.py.

00164 
00165     def name(self):
00166         return self._name

Here is the caller graph for this function:

def multiprocessing.process.Process.name (   self,
  name 
) [inherited]

Definition at line 168 of file process.py.

00168 
00169     def name(self, name):
00170         assert isinstance(name, str), 'name must be a string'
00171         self._name = name

Here is the call graph for this function:

Here is the caller graph for this function:

Method to be run in sub-process; can be overridden in sub-class

Reimplemented from multiprocessing.process.Process.

Definition at line 308 of file test_multiprocessing.py.

00308 
00309     def run(self):
00310         self.parent_conn.close()
00311         for s in iter(self.child_conn.recv, None):
00312             self.child_conn.send(s.upper())
00313         self.child_conn.close()

Here is the caller graph for this function:

def multiprocessing.process.Process.start (   self) [inherited]
Start child process

Definition at line 118 of file process.py.

00118 
00119     def start(self):
00120         '''
00121         Start child process
00122         '''
00123         assert self._popen is None, 'cannot start a process twice'
00124         assert self._parent_pid == os.getpid(), \
00125                'can only start a process object created by current process'
00126         assert not _current_process._daemonic, \
00127                'daemonic processes are not allowed to have children'
00128         _cleanup()
00129         if self._Popen is not None:
00130             Popen = self._Popen
00131         else:
00132             from .forking import Popen
00133         self._popen = Popen(self)
00134         _current_process._children.add(self)

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 319 of file test_multiprocessing.py.

00319 
00320     def stop(self):
00321         self.parent_conn.send(None)
00322         self.parent_conn.close()
00323         self.child_conn.close()

Here is the caller graph for this function:

Definition at line 314 of file test_multiprocessing.py.

00314 
00315     def submit(self, s):
00316         assert type(s) is str
00317         self.parent_conn.send(s)
00318         return self.parent_conn.recv()

def multiprocessing.process.Process.terminate (   self) [inherited]
Terminate process; sends SIGTERM signal or uses TerminateProcess()

Definition at line 135 of file process.py.

00135 
00136     def terminate(self):
00137         '''
00138         Terminate process; sends SIGTERM signal or uses TerminateProcess()
00139         '''
00140         self._popen.terminate()

Here is the caller graph for this function:


Member Data Documentation

Definition at line 107 of file object.h.

struct _typeobject* _object::ob_type [inherited]

Definition at line 108 of file object.h.

Definition at line 306 of file test_multiprocessing.py.

Definition at line 217 of file process.py.


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