Cancels the current job.
508538
public synchronized void cancel() {
    for (int taskId : mJobInfo.getTaskIdList()) {
      mCommandManager.submitCancelTaskCommand(mJobInfo.getId(), taskId,
          mTaskIdToWorkerInfo.get(taskId).getId());
    }
  }
1192778
def terminate(self):
        """"""
        self.close()

        # Clearing the job queue
        try:
            while 1:
                self._workq.get_nowait()
        except queue.Empty:
            pass

        # Send one sentinel for each worker thread: each thread will die
        # eventually, leaving the next sentinel for the next thread
        for _ in self._workers:
            self._workq.put(SENTINEL)
1326626
def mark_job_as_canceling(self, job_id):
        

        job, _ = self._update_job_state(job_id, State.CANCELING)
        return job
1315310
def abort_job(self, job_id):
        """"""
        doc = self.create_abort_job_doc()
        url = self.endpoint + "/job/%s" % job_id
        resp = requests.post(
            url,
            headers=self.headers(),
            data=doc
        )
        self.check_status(resp)
594206
def cancel(id)
      Log.warn "Cancelling job id #{id}"
      job = @jobs_by_id[id]
      job.status = Executor::STATUS_ERROR
      job.owner = nil
      job.time_end = Time.now
      @queue.delete(job)
    end
918294
def _cancel(self, msgId):
        
        _, canceller = self._requests.pop(msgId, (None, None))

        if canceller is not None and canceller.active():
            canceller.cancel()
166636
public function cancel() {
        switch ($this->state) {
            case self::STATE_SHEDULED:
                $this->state = self::STATE_NONE;
                $this->counter = 0;
                break;
        }
        return false;
    }
138749
def request_job_cancel(self, job_id):
        
        msg = CancelMessage(job_id)
        self.messaging_backend.send(self.worker_mailbox, msg)
        self.storage_backend.mark_job_as_canceling(job_id)
1359634
async def cancel(self):
        """"""
        self.is_cancelled = True
        if self.future is not None:
            self.future.cancel()
        if self.task_process is not None:
            log.warning("Worker is shutting down, but a task is running. Terminating task")
            await self.task_process.worker_shutdown_stop()
455114
public function cancel()
    {
        if ($this->id === null) {
            return false;
        }

        $key = $this->queue->generateListKey();
        $id = "$key:" . $this->id;

        // Delete the job from the current and scheduled queue, then remove the job details from Redis
        $result = $this->queue->getClient()->getRedis()->multi()
            ->zrem($key)
            ->zrem($key . '-scheduled')
            ->del($id)
            ->hset(\date('Y-m-d') . '_cancel', (string)\time(), \json_encode([
                'class' => $this->getWorkerClass(),
                'args' => $this->getArgs(),
                'priority' => (float)$this->getPriority(),
                'id' => $this->getId()
            ]))
            ->exec();

        $this->workerClass = null;
        $this->args = [];
        $this->retry = null;
        $this->priority = null;

        return $result[0] === true || $result[1] === true;
    }
1264420
def cancelPendingResultsFor( self, ps ):
        """"""
        k = self._parametersAsIndex(ps)

        if k in self._results.keys():
            # remove from results
            rs = self._results[k]
            js = [ j for j in rs if not isinstance(j, dict) ]
            self._results[k] = [ rc for rc in rs if isinstance(rc, dict) ]

            # ...and from pending jobs list
            for j in js:
                del self._pending[j]
461989
def cancel(self, job_ids):
        ''' 
        '''

        job_id_list = ' '.join(job_ids)
        retcode, stdout, stderr = self.channel.execute_wait("qdel {0}".format(job_id_list), 3)
        rets = None
        if retcode == 0:
            for jid in job_ids:
                self.resources[jid]['status'] = translate_table['E']  # Setting state to exiting
            rets = [True for i in job_ids]
        else:
            rets = [False for i in job_ids]

        return rets
461809
public void cancelJob(CancelJobRequest request) {
        checkNotNull(request, "request should not be null.");
        checkStringNotEmpty(request.getJobId(), "The parameter jobId should not be null or empty string.");

        InternalRequest internalRequest = this.createRequest(
                request, HttpMethodName.PUT, JOB, request.getJobId());
        internalRequest.addParameter("cancel", null);

        this.invokeHttpClient(internalRequest, AbstractBceResponse.class);
    }
125375
public void cancelFaxJob(FaxJob faxJob)
    {
        //validate fax job ID
        this.invokeFaxJobIDValidation(faxJob);
        
        //invoke action
        this.cancelFaxJobImpl(faxJob);
        
        //fire event
        this.fireFaxEvent(FaxClientActionEventID.CANCEL_FAX_JOB,faxJob);
    }
824219
def cancel(self):
        '''
        
        '''
        if (not self.cancelled) and (self._fn is not None):
            self._cancelled = True
            self._drop_fn()
691680
def cancel(self, job_ids):
        ''' 
        '''

        for job in job_ids:
            logger.debug("Terminating job/proc_id : {0}".format(job))
            # Here we are assuming that for local, the job_ids are the process id's
            proc = self.resources[job]['proc']
            os.killpg(os.getpgid(proc.pid), signal.SIGTERM)
            self.resources[job]['status'] = 'CANCELLED'
        rets = [True for i in job_ids]

        return rets
1130843
function(results, job, done) {
                    process.stdout.write(JSON.stringify(results));
                    job.cancel(done);
                }