'Initializer.
This creates a new worker object for the ThreadPool class.
Args:
queue: A Queue.Queue object that is used by the ThreadPool class to
communicate with the workers. When a new task arrives, the ThreadPool
notifies the workers by putting a message into this queue that has the
format (target, args, name, queueing_time).
target - A callable, the function to call.
args - A tuple of positional arguments to target. Keyword arguments
are not supported.
name - A name for this task. If None, it will be unique generated by
the threading library.
queueing_time - The timestamp when this task was queued as returned by
time.time().
Or, alternatively, the message in the queue can be STOP_MESSAGE
which indicates that the worker should terminate.
pool: The thread pool this worker belongs to.'

def __init__(self, queue, pool):

    super(_WorkerThread, self).__init__()
    if pool.name:
        self.name = ((pool.name + '-') + self.name)
    self.pool = pool
    self._queue = queue
    self.daemon = True
    self.idle = True
    self.started = time.time()
