'Consume the queue items, sending them to the plugins which are then
going to find vulnerabilities, new URLs, etc.'

def run(self):

    while True:
        try:
            work_unit = self.in_queue.get(timeout=0.1)
        except KeyboardInterrupt:
            continue
        except Queue.Empty:
            try:
                self._route_all_plugin_results()
            except KeyboardInterrupt:
                continue
        else:
            if (work_unit == POISON_PILL):
                self._threadpool.close()
                self._threadpool.join()
                del self._threadpool
                self._running = False
                self._teardown()
                self._out_queue.put(POISON_PILL)
                self.in_queue.task_done()
                break
            else:
                try:
                    self._consume(work_unit)
                except KeyboardInterrupt:
                    self.in_queue.task_done()
                except:
                    self.in_queue.task_done()
                else:
                    self.in_queue.task_done()
                work_unit = None
