Define the job of each process to run.
421959
def run(self):
        '''
        '''
        if self.verbose:
            pbar = tqdm(total=100)
        while True:
            task_remain = self._task_queue.qsize()
            task_finished = int((float(self.total_task - task_remain) /
                                 float(self.total_task)) * 100)
            if task_finished % 20 == 0 and task_finished != self.current_state:
                self.current_state = task_finished
                logger.info('{0}% done'.format(task_finished))
                if self.verbose and task_finished > 0:
                    pbar.update(20)
            if task_remain == 0:
                break
        logger.debug('All task data cleared')
1374304
def run(self):
        """"""
        config = self.state.document.settings.env.config

        # Group processes by category
        processes = get_processes(config.autoprocess_process_dir, config.autoprocess_source_base_url)
        processes.sort(key=itemgetter('type'))
        processes_by_types = {k: list(g) for k, g in groupby(processes, itemgetter('type'))}

        listnode = nodes.bullet_list()

        for typ in sorted(processes_by_types.keys()):
            par = nodes.paragraph()
            par += nodes.literal(typ, typ)
            par += nodes.Text(' - ')

            processes = sorted(processes_by_types[typ], key=itemgetter('name'))
            last_process = processes[-1]
            for process in processes:
                node = nodes.reference('', process['name'], internal=True)
                node['refuri'] = config.autoprocess_definitions_uri + '#process-' + process['slug']
                node['reftitle'] = process['name']
                par += node
                if process != last_process:
                    par += nodes.Text(', ')

            listnode += nodes.list_item('', par)

        return [listnode]
261785
def runm():
    
    signal.signal(signal.SIGINT, signal_handler)
    count = int(sys.argv.pop(1))
    processes = [Process(target=run, args=()) for x in range(count)]
    try:
        for p in processes:
            p.start()
    except KeyError:
        # Not sure why we see a keyerror here. Weird.
        pass
    finally:
        for p in processes:
            p.join()
1145059
public function proccess()
    {
        foreach ($this->runningJobs as $jobData) {
            $this->isRunning($jobData->job);
        }

        foreach ($this->pendingJobs as $job) {
            $this->start($job);
        }
    }
32685
public void runProcess(BaseProcess job, Map<String,Object> properties)
    {
        if (properties == null)
            properties = new HashMap<String,Object>();
        Map<String,Object> propMessage = m_message.getMessageHeader().getProperties();
        if (propMessage != null)
            properties.putAll(propMessage);
        properties.put(DBParams.MESSAGE, m_message);
        
        job.init(this, null, properties);

        job.run();
        job.free();
    }
1092844
def running_jobs(self, exit_on_error=True):
        """"""
        with self.handling_exceptions():
            if self.using_jobs:
                from concurrent.futures import ProcessPoolExecutor
                try:
                    with ProcessPoolExecutor(self.jobs) as self.executor:
                        yield
                finally:
                    self.executor = None
            else:
                yield
        if exit_on_error:
            self.exit_on_error()
936353
protected function job(): void
    {
        $titles = $this->retrieve([
            'corporation_id' => $this->getCorporationId(),
        ]);

        if ($titles->isCachedLoad()) return;

        collect($titles)->each(function ($title) {

            CorporationTitle::firstOrNew([
                'corporation_id' => $this->getCorporationId(),
                'title_id'       => $title->title_id,
            ])->fill([
                'name' => $title->name ?? sprintf('Untitled %d', (int) sqrt($title->title_id - 1)),
            ])->save();

            collect($this->types)->each(function ($type) use ($title) {

                if (! property_exists($title, $type))
                    return;

                collect($title->{$type})->each(function ($name) use ($title, $type) {

                    CorporationTitleRole::firstOrCreate([
                        'corporation_id' => $this->getCorporationId(),
                        'title_id'       => $title->title_id,
                        'type'           => $type,
                        'role'           => $name,
                    ]);
                });

                CorporationTitleRole::where('corporation_id', $this->getCorporationId())
                    ->where('title_id', $title->title_id)
                    ->where('type', $type)
                    ->whereNotIn('role', collect($title->{$type})->flatten()->all())
                    ->delete();

            });

            $this->known_titles->push($title->title_id);

        });

        CorporationTitle::where('corporation_id', $this->getCorporationId())
            ->whereNotIn('title_id', $this->known_titles->flatten()->all())
            ->delete();
    }
535395
def run(self):
        """"""
        config = self.state.document.settings.env.config

        # Get all processes:
        processes = get_processes(config.autoprocess_process_dir, config.autoprocess_source_base_url)
        process_nodes = []

        for process in sorted(processes, key=itemgetter('name')):
            process_nodes.extend(self.make_process_node(process))

        return process_nodes
747567
public void runJob()
    {
        try {
            this.currentJob = this.jobQueue.take();

            // Create a clean Execution Context
            ExecutionContext context = new ExecutionContext();

            try {
                this.executionContextManager.initialize(context);
            } catch (ExecutionContextException e) {
                throw new RuntimeException("Failed to initialize Job " + this.currentJob + " execution context", e);
            }

            this.currentJob.run();
        } catch (InterruptedException e) {
            // Thread has been stopped
        } finally {
            this.execution.removeContext();
        }
    }
1230931
def build_job_scripts(root_dir, jobs):
    
    # Loop over the job list, creating each job script in turn, and then adding
    # scriptPath to the Job object
    for job in jobs:
        scriptpath = os.path.join(root_dir, "jobs", job.name)
        with open(scriptpath, "w") as scriptfile:
            scriptfile.write("#!/bin/sh\n#$ -S /bin/bash\n%s\n" % job.script)
        job.scriptpath = scriptpath
1310017
def run_with_output(self, *args, **kwargs):
    """"""
    for job in self.jobs:
      job.run_with_output(*args, **kwargs)
88658
def run_job(self, name):
        '''
        
        '''
        data = self._get_schedule().get(name, {})

        if 'function' in data:
            func = data['function']
        elif 'func' in data:
            func = data['func']
        elif 'fun' in data:
            func = data['fun']
        else:
            func = None
        if not isinstance(func, list):
            func = [func]
        for _func in func:
            if _func not in self.functions:
                log.error(
                    'Invalid function: %s in scheduled job %s.',
                    _func, name
                )

        if 'name' not in data:
            data['name'] = name
        log.info('Running Job: %s', name)

        # Grab run, assume True
        run = data.get('run', True)
        if run:
            self._run_job(_func, data)
1373052
private function runCustomProcess()
    {
        if ($this->isCustomProcessSet()) {
            $this->getCustomProcess()->run();
        } elseif (class_exists('\extensions\core\Process')) {
            \extensions\core\Process::getInstance()->run();
        }
    }
648433
def run(cls):
        
        if not all(v is None for v in cls._services.values()):
            cls._set_host_id()
            cls._setup_logging()
            cls._set_process_name()
            cls._set_signal_handlers()
            cls._start_server()
        else:
            cls._logger.error('No services to host')
214684
def run_job(args):
  """"""
  jm = setup(args)
  job_id = int(os.environ['JOB_ID'])
  array_id = int(os.environ['SGE_TASK_ID']) if os.environ['SGE_TASK_ID'] != 'undefined' else None
  jm.run_job(job_id, array_id)
923549
def term_all_jobs():
    '''
    
    '''
    ret = []
    for data in running():
        ret.append(signal_job(data['jid'], signal.SIGTERM))
    return ret
147218
public void runProcess(BaseProcess job, Map<String,Object> properties)
    {
        job.init(this, null, properties);
        job.run();
        job.free();
    }