Kill all processes, delete the queue and clean everything up.
504752
def reset_everything(self, payload):
        """"""
        kill_signal = signals['9']
        self.process_handler.kill_all(kill_signal, True)
        self.process_handler.wait_for_finish()
        self.reset = True

        answer = {'message': 'Resetting current queue', 'status': 'success'}
        return answer
1233445
public function cleanUp()
    {
        $this->status = self::STATUS_CLEANINGUP;
        if ($this->process->isRunning()) {
            $this->sendTERMSignal();
        } else {
            $this->status = self::STATUS_CLEANEDUP;
        }

    }
372689
def cleanup(self):
        
        if self.transport:
            self.transport.close()
            self.transport = None
        if self.task:
            self.task.cancel()
            self.task = None
255008
def kill_all(self):
        
        logger.info('Job {0} killing all currently running tasks'.format(self.name))
        for task in self.tasks.itervalues():
            if task.started_at and not task.completed_at:
                task.kill()
532228
public static function delAll()
    {
        if (count(self::$_tasks) > 0) {
            foreach (self::$_tasks as $k => $v) {
                swoole_timer_clear($k);
            }
            self::$_tasks = array();
        }
    }
175614
def kill(self):
        
        try:
            kill(int(self.get()), 9)
            
        # Failed to kill the process
        except Exception as e:
            self.die('Failed to kill process: {}'.format(str(e)))
            
        # Remove the stale PID file
        self.remove()
986810
def _clear_process(self):
        
        if self.process:
            if self.process.stdin:
                self.process.stdin.close()
            if self.process.stdout:
                self.process.stdout.close()

            self.process = None

        self._endtime = None
562444
def kill_all_jobs():
    '''
    
    '''
    # Some OS's (Win32) don't have SIGKILL, so use salt_SIGKILL which is set to
    # an appropriate value for the operating system this is running on.
    ret = []
    for data in running():
        ret.append(signal_job(data['jid'], salt_SIGKILL))
    return ret
1332137
def kill(self):
        
        if self.running():
            if self.verbose:
                print('Killing {} with PID {}'.format(self.exe, self.process.pid))
            self.process.kill()

            # Threads *should* tidy up after themselves, but we do it explicitly
            self.join_threads()
741219
void cleanUp() {
    if (threadStarted) {
      return;
    }

    Reference<?> reference;
    while ((reference = queue.poll()) != null) {
      /*
       * This is for the benefit of phantom references. Weak and soft
       * references will have already been cleared by this point.
       */
      reference.clear();
      try {
        ((FinalizableReference) reference).finalizeReferent();
      } catch (Throwable t) {
        logger.log(Level.SEVERE, "Error cleaning up after reference.", t);
      }
    }
  }
209465
def kill_all(job_queue, reason='None given', states=None):
    """"""
    if states is None:
        states = ['STARTING', 'RUNNABLE', 'RUNNING']
    batch = boto3.client('batch')
    runnable = batch.list_jobs(jobQueue=job_queue, jobStatus='RUNNABLE')
    job_info = runnable.get('jobSummaryList')
    if job_info:
        job_ids = [job['jobId'] for job in job_info]
        # Cancel jobs
        for job_id in job_ids:
            batch.cancel_job(jobId=job_id, reason=reason)
    res_list = []
    for status in states:
        running = batch.list_jobs(jobQueue=job_queue, jobStatus=status)
        job_info = running.get('jobSummaryList')
        if job_info:
            job_ids = [job['jobId'] for job in job_info]
            for job_id in job_ids:
                logger.info('Killing %s' % job_id)
                res = batch.terminate_job(jobId=job_id, reason=reason)
                res_list.append(res)
    return res_list
1000039
public static void killAll()
  {
    Collection<TaskQueue> taskQueues = new ArrayList<TaskQueue>( QUEUE_MAP.values() );
    for( TaskQueue taskQueue : taskQueues )
    {
      emptyAndRemoveQueue( taskQueue.getName() );
    }
  }
747576
public function cleanup(): void
    {
        foreach ($this->getStore() as $key => $value)
        {
            $this->remove($key);
        }
    }
1051308
def clean_up(self):
        '''  '''
        self.socket.close()
        for h in self.capture_handlers:
            h['logger'].close()
547589
private function cleanupDeadProcesses()
    {
        $processes = ezpContentPublishingProcess::fetchProcesses( ezpContentPublishingProcess::STATUS_WORKING );
        foreach( $processes as $process )
        {
            if ( !$process->isAlive() )
            {
                $process->reset();
            }
        }
    }
443861
protected function cleanup()
    {
        $this->filesystem->remove($this->tmpFolder);
        $this->root = null;
        $this->urlsets = array();
    }
836955
def clean(self):
        
        for _, item in self.queue.items():
            if item['status'] in ['paused', 'running', 'stopping', 'killing']:
                item['status'] = 'queued'
                item['start'] = ''
                item['end'] = ''