cpython: 57d6265beaaa (original) (raw)

Mercurial > cpython

changeset 77140:57d6265beaaa

Issue #12091: simplify ApplyResult and MapResult with threading.Event Patch by Charles-François Natali [#12091]

Richard Oudkerk shibturn@gmail.com
date Fri, 25 May 2012 13:26:53 +0100
parents 9373ca8c6c55
children 59567c117b0e
files Lib/multiprocessing/pool.py
diffstat 1 files changed, 9 insertions(+), 30 deletions(-)[+] [-] Lib/multiprocessing/pool.py 39

line wrap: on

line diff

--- a/Lib/multiprocessing/pool.py +++ b/Lib/multiprocessing/pool.py @@ -526,32 +526,26 @@ class Pool(object): class ApplyResult(object): def init(self, cache, callback, error_callback):

def ready(self):

def successful(self):

def wait(self, timeout=None):

def get(self, timeout=None): self.wait(timeout)

@@ -564,12 +558,7 @@ class ApplyResult(object): self._callback(self._value) if self._error_callback and not self._success: self._error_callback(self._value)

# @@ -586,7 +575,7 @@ class MapResult(ApplyResult): self._chunksize = chunksize if chunksize <= 0: self._number_left = 0

@@ -599,24 +588,14 @@ class MapResult(ApplyResult): if self._callback: self._callback(self._value) del self._cache[self._job]

#

Class whose instances are returned by Pool.imap()