'Handler called when task is accepted by worker pool.'

def on_accepted(self, pid, time_accepted):

    self.worker_pid = pid
    self.time_start = time_accepted
    task_accepted(self)
    if (not self.task.acks_late):
        self.acknowledge()
    self.send_event(u'task-started')
    if _does_debug:
        debug(u'Task    accepted:    %s[%s]    pid:%r', self.name, self.id, pid)
    if (self._terminate_on_ack is not None):
        self.terminate(*self._terminate_on_ack)
