(self, func, iterable, chunksize=1)
Like `imap()` method but ordering of results is arbitrary.
Like `imap()` method but ordering of results is arbitrary.
Like imap () method but ordering of results is arbitrary .
def imap_unordered(self, func, iterable, chunksize=1):
        '''
        Like `imap()` method but ordering of results is arbitrary.
        '''
        self._check_running()
        if chunksize == 1:
            result = IMapUnorderedIterator(self)
            self._taskqueue.put(
                (
                    self._guarded_task_generation(result._job, func, iterable),
                    result._set_length
                ))
            return result
        else:
            if chunksize < 1:
                raise ValueError(
                    "Chunksize must be 1+, not {0!r}".format(chunksize))
            task_batches = Pool._get_tasks(func, iterable, chunksize)
            result = IMapUnorderedIterator(self)
            self._taskqueue.put(
                (
                    self._guarded_task_generation(result._job,
                                                  mapstar,
                                                  task_batches),
                    result._set_length
                ))
            return (item for chunk in result for item in chunk)
def imap_unordered ( self , func , iterable , chunksize = 1 ) : self . _check_running ( ) if chunksize == 1 : result = IMapUnorderedIterator ( self ) self . _taskqueue . put ( ( self . _guarded_task_generation ( result . _job , func , iterable ) , result . _set_length ) ) return result else : if chunksize < 1 : raise ValueError ( "Chunksize must be 1+, not {0!r}" . format ( chunksize ) ) task_batches = Pool . _get_tasks ( func , iterable , chunksize ) result = IMapUnorderedIterator ( self ) self . _taskqueue . put ( ( self . _guarded_task_generation ( result . _job , mapstar , task_batches ) , result . _set_length ) ) return ( item for chunk in result for item in chunk )