'Spawned worker threads. These threads loop until queue is empty.'

def _new_worker(self):

    while True:
        data = self.queue.get()
        if (data == 'die'):
            return
        try:
            self.function(data)
        except Exception as full_error:
            print ('Unexpected    failure    in    the    thread    calling    %s:    %s' % (self.function.__name__, full_error))
