Back to index

python3.2  3.2.2
Public Member Functions | Public Attributes | Private Member Functions | Private Attributes
multiprocessing.pool.ApplyResult Class Reference
Inheritance diagram for multiprocessing.pool.ApplyResult:
Inheritance graph
[legend]
Collaboration diagram for multiprocessing.pool.ApplyResult:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def __init__
def ready
def successful
def wait
def get

Public Attributes

_PyObject_HEAD_EXTRA Py_ssize_t ob_refcnt
struct _typeobjectob_type

Private Member Functions

def _set

Private Attributes

 _cond
 _job
 _cache
 _ready
 _callback
 _error_callback
 _value

Detailed Description

Definition at line 519 of file pool.py.


Constructor & Destructor Documentation

def multiprocessing.pool.ApplyResult.__init__ (   self,
  cache,
  callback,
  error_callback 
)

Definition at line 521 of file pool.py.

00521 
00522     def __init__(self, cache, callback, error_callback):
00523         self._cond = threading.Condition(threading.Lock())
00524         self._job = next(job_counter)
00525         self._cache = cache
00526         self._ready = False
00527         self._callback = callback
00528         self._error_callback = error_callback
00529         cache[self._job] = self

Here is the caller graph for this function:


Member Function Documentation

def multiprocessing.pool.ApplyResult._set (   self,
  i,
  obj 
) [private]

Reimplemented in multiprocessing.pool.MapResult.

Definition at line 554 of file pool.py.

00554 
00555     def _set(self, i, obj):
00556         self._success, self._value = obj
00557         if self._callback and self._success:
00558             self._callback(self._value)
00559         if self._error_callback and not self._success:
00560             self._error_callback(self._value)
00561         self._cond.acquire()
00562         try:
00563             self._ready = True
00564             self._cond.notify()
00565         finally:
00566             self._cond.release()
00567         del self._cache[self._job]
00568 
00569 #
00570 # Class whose instances are returned by `Pool.map_async()`
00571 #

Here is the caller graph for this function:

def multiprocessing.pool.ApplyResult.get (   self,
  timeout = None 
)

Definition at line 545 of file pool.py.

00545 
00546     def get(self, timeout=None):
00547         self.wait(timeout)
00548         if not self._ready:
00549             raise TimeoutError
00550         if self._success:
00551             return self._value
00552         else:
00553             raise self._value

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 530 of file pool.py.

00530 
00531     def ready(self):
00532         return self._ready

Definition at line 533 of file pool.py.

00533 
00534     def successful(self):
00535         assert self._ready
00536         return self._success

def multiprocessing.pool.ApplyResult.wait (   self,
  timeout = None 
)

Definition at line 537 of file pool.py.

00537 
00538     def wait(self, timeout=None):
00539         self._cond.acquire()
00540         try:
00541             if not self._ready:
00542                 self._cond.wait(timeout)
00543         finally:
00544             self._cond.release()

Here is the caller graph for this function:


Member Data Documentation

Definition at line 524 of file pool.py.

Definition at line 526 of file pool.py.

Definition at line 522 of file pool.py.

Definition at line 527 of file pool.py.

Definition at line 523 of file pool.py.

Reimplemented in multiprocessing.pool.MapResult.

Definition at line 525 of file pool.py.

Reimplemented in multiprocessing.pool.MapResult.

Definition at line 555 of file pool.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: