(self)
Stops the worker processes immediately without completing
        outstanding work. When the pool object is garbage collected
        terminate() will be called immediately.
Stops the worker processes immediately without completing
        outstanding work. When the pool object is garbage collected
        terminate() will be called immediately.
Stops the worker processes immediately without completing outstanding work . When the pool object is garbage collected terminate () will be called immediately .
def terminate(self):
        """Stops the worker processes immediately without completing
        outstanding work. When the pool object is garbage collected
        terminate() will be called immediately."""
        self.close()

        # Clearing the job queue
        try:
            while 1:
                self._workq.get_nowait()
        except queue.Empty:
            pass

        # Send one sentinel for each worker thread: each thread will die
        # eventually, leaving the next sentinel for the next thread
        for _ in self._workers:
            self._workq.put(SENTINEL)
def terminate ( self ) : self . close ( ) # Clearing the job queue try : while 1 : self . _workq . get_nowait ( ) except queue . Empty : pass # Send one sentinel for each worker thread: each thread will die # eventually, leaving the next sentinel for the next thread for _ in self . _workers : self . _workq . put ( SENTINEL )