Called with a specific TaskStatus that must be delivered to the driver.
501963
public synchronized void sendTaskStatus(final ReefServiceProtos.TaskStatusProto taskStatusProto) {
    this.sendHeartBeat(this.getEvaluatorHeartbeatProto(
        this.evaluatorRuntime.get().getEvaluatorStatus(),
        this.contextManager.get().getContextStatusCollection(),
        Optional.of(taskStatusProto)));
  }
822351
def on_task_status(self, task):
        ''''''
        try:
            procesok = task['track']['process']['ok']
            if not self.projects[task['project']].task_queue.done(task['taskid']):
                logging.error('not processing pack: %(project)s:%(taskid)s %(url)s', task)
                return None
        except KeyError as e:
            logger.error("Bad status pack: %s", e)
            return None

        if procesok:
            ret = self.on_task_done(task)
        else:
            ret = self.on_task_failed(task)

        if task['track']['fetch'].get('time'):
            self._cnt['5m_time'].event((task['project'], 'fetch_time'),
                                       task['track']['fetch']['time'])
        if task['track']['process'].get('time'):
            self._cnt['5m_time'].event((task['project'], 'process_time'),
                                       task['track']['process'].get('time'))
        self.projects[task['project']].active_tasks.appendleft((time.time(), task))
        return ret
1115388
def handle_task(self, uuid_task, worker=None):
        """"""
        uuid, task = uuid_task
        if task.worker and task.worker.hostname:
            worker = self.handle_worker(
                (task.worker.hostname, task.worker),
            )

        defaults = {
            'name': task.name,
            'args': task.args,
            'kwargs': task.kwargs,
            'eta': correct_awareness(maybe_iso8601(task.eta)),
            'expires': correct_awareness(maybe_iso8601(task.expires)),
            'state': task.state,
            'tstamp': fromtimestamp(task.timestamp),
            'result': task.result or task.exception,
            'traceback': task.traceback,
            'runtime': task.runtime,
            'worker': worker
        }
        # Some fields are only stored in the RECEIVED event,
        # so we should remove these from default values,
        # so that they are not overwritten by subsequent states.
        [defaults.pop(attr, None) for attr in NOT_SAVED_ATTRIBUTES
         if defaults[attr] is None]
        return self.update_task(task.state,
                                task_id=uuid, defaults=defaults)
356715
public synchronized void notifyTaskCompletion(long jobId, int taskId, Object result) {
    Pair<Long, Integer> id = new Pair<>(jobId, taskId);
    TaskInfo.Builder taskInfo = mUnfinishedTasks.get(id);
    taskInfo.setStatus(Status.COMPLETED);
    try {
      taskInfo.setResult(ByteString.copyFrom(SerializationUtils.serialize(result)));
    } catch (IOException e) {
      // TODO(yupeng) better error handling
      LOG.warn("Failed to serialize {} : {}", result, e.getMessage());
      LOG.debug("Exception: ", e);
    } finally {
      finishTask(id);
      LOG.info("Task {} for job {} completed.", taskId, jobId);
    }
  }
536365
def sendoff_current_user(self):
        
        msgs = self.task_data.get('LANE_CHANGE_MSG', DEFAULT_LANE_CHANGE_MSG)
        self.msg_box(title=msgs['title'], msg=msgs['body'])
706865
function(task) {

		if (this._active_tasks.indexOf(task) == -1) {

			this._active_tasks.push(task);

		}

		this._enable();

		if (!this.is_running) {
			this._enable();
			this.is_running = true;
		}

	}
1195829
def result_consumed(self, task_id):
        """"""
        logger.debug('Sending result consumed message.')
        data = {
            'task_ids': task_id,
        }
        return self._perform_post_request(self.results_consumed_endpoint, data, self.token_header)
1217140
def on_new_request(self, task):
        ''''''
        task['status'] = self.taskdb.ACTIVE
        self.insert_task(task)
        self.put_task(task)

        project = task['project']
        self._cnt['5m'].event((project, 'pending'), +1)
        self._cnt['1h'].event((project, 'pending'), +1)
        self._cnt['1d'].event((project, 'pending'), +1)
        self._cnt['all'].event((project, 'pending'), +1)
        logger.info('new task %(project)s:%(taskid)s %(url)s', task)
        return task
203742
def task_status(self, task_id):
        """"""
        data = {
            'task_ids': task_id,
        }
        return self._perform_post_request(self.task_status_endpoint, data, self.token_header)
109444
private TaskRecord waitForTaskStatus(Tenant tenant, Task task, Predicate<TaskStatus> pred) {
        TaskRecord taskRecord = null;
        while (true) {
            Iterator<DColumn> colIter =
                DBService.instance(tenant).getAllColumns(TaskManagerService.TASKS_STORE_NAME, task.getTaskID()).iterator();
            if (!colIter.hasNext()) {
                taskRecord = storeTaskRecord(tenant, task);
            } else {
                taskRecord = buildTaskRecord(task.getTaskID(), colIter);
            }
            if (pred.test(taskRecord.getStatus())) {
                break;
            }
            try { Thread.sleep(TASK_CHECK_MILLIS); } catch (InterruptedException e) { }
        };
        return taskRecord;
    }
851181
def action(a, c = nil)
      if !self.driver.in_driver_context?
        # Called from outside Driver. Send an async message to Driver.
        self.driver.message(:action, [a, c])
      else
        # Called from within Driver.
        if self.respond_to?(a)
          command = self.send(a)

          case command
            when String
              msg = "#{self.name} #{a}: #{command}"
              applog(self, :info, msg)

              system(command)
            when Proc
              msg = "#{self.name} #{a}: lambda"
              applog(self, :info, msg)

              command.call
            else
              raise NotImplementedError
          end
        end
      end
    end
740333
def SampleTaskStatus(self, task, status):
    
    if self._tasks_profiler:
      self._tasks_profiler.Sample(task, status)
81001
public TaskStatus getTaskStatus() {
    TaskStatusUpdate update = get(TaskStatusUpdate.class);
    if (update == null) {
      return null;
    }
    return update.getStatus();
  }
1170426
def idle_task(self):
        ''''''
        self.pstate.vehicle_name = self.vehicle_name
        self.pstate.fetch_check(self.master)
789348
def task_control(self):
        """"""
        return TaskControl(
                        self,
                        self.state,
                        self.path,
                        self._gateway)
157409
def wait_for_task(task_data, task_uri='/tasks'):
    
    taskid = post_task(task_data, task_uri)

    if isinstance(task_data, str):
        json_data = json.loads(task_data)
    else:
        json_data = task_data

    # inspect the task to see if a timeout is configured
    job = json_data['job'][0]
    env = job.get('credentials')
    task_type = job.get('type')

    timeout = TASK_TIMEOUTS.get(env, dict()).get(task_type, DEFAULT_TASK_TIMEOUT)

    LOG.debug("Task %s will timeout after %s", task_type, timeout)

    return check_task(taskid, timeout)
206335
def CheckTaskToMerge(self, task):
    
    with self._lock:
      is_abandoned = task.identifier in self._tasks_abandoned
      is_processing = task.identifier in self._tasks_processing
      is_queued = task.identifier in self._tasks_queued

      if not is_queued and not is_processing and not is_abandoned:
        raise KeyError('Status of task {0:s} is unknown.'.format(
            task.identifier))

      return is_queued or is_processing or is_abandoned and not task.has_retry