Processes a given job in the child.
180699
def perform(job)
      begin
        if fork_per_job?
          reconnect
          run_hook :after_fork, job
        end
        job.perform
      rescue Object => e
        report_failed_job(job,e)
      else
        log_with_severity :info, "done: #{job.inspect}"
      ensure
        yield job if block_given?
      end
    end
1229239
def child_task(self):
        ''''''
        self.parent_pipe_send.close()
        self.parent_pipe_recv.close()

        from MAVProxy.modules.lib import wx_processguard
        from MAVProxy.modules.lib.wx_loader import wx
        from MAVProxy.modules.lib.wxconsole_ui import ConsoleFrame
        app = wx.App(False)
        app.frame = ConsoleFrame(state=self, title=self.title)
        app.frame.SetDoubleBuffered(True)
        app.frame.Show()
        app.MainLoop()
286184
protected function loop(): void
    {
        $job = $this->getJob();

        if (!$job) {
            $this->sleep();

            return;
        }

        $this->log->info(sprintf('got Job %s', $job->getId()));

        $this->getEventManager()->trigger('beforeFork', $job);
        $this->setWorkingOn($job);

        $this->child = $this->fork();

        // We are the Child Process
        if ($this->child === 0 || $this->child === false) {
            $this->runAsChild($job);
        }

        // We are the parent Process
        if ($this->child > 0) {
            $this->runAsParent($job);
        }

        $this->child = null;
        $this->finishedWorking();
    }
207421
protected function job(): void
    {
        while (true) {

            $shareholders = $this->retrieve([
                'corporation_id' => $this->getCorporationId(),
            ]);

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

            collect($shareholders)->each(function ($shareholder) {

                CorporationShareholder::firstOrNew([
                    'corporation_id'   => $this->getCorporationId(),
                    'shareholder_type' => $shareholder->shareholder_type,
                    'shareholder_id'   => $shareholder->shareholder_id,
                ])->fill([
                    'share_count' => $shareholder->share_count,
                ])->save();

            });

            $this->known_shareholders->push(collect($shareholders)
                ->pluck(['shareholder_type', 'shareholder_id'])->flatten()->all());

            if (! $this->nextPage($shareholders->pages))
                break;
        }

        CorporationShareholder::where('corporation_id', $this->getCorporationId())
            ->whereNotIn('shareholder_id', $this->known_shareholders->flatten()->all())
            ->delete();
    }
187204
def prepare_outputs(self, job):
        
        outputs = flatten(job.output())
        for o in outputs:
            if isinstance(o, FileSystemTarget):
                parent_dir = os.path.dirname(o.path)
                if parent_dir and not o.fs.exists(parent_dir):
                    logger.info("Creating parent directory %r", parent_dir)
                    try:
                        # there is a possible race condition
                        # which needs to be handled here
                        o.fs.mkdir(parent_dir)
                    except FileAlreadyExists:
                        pass
11679
protected void dispatch(Throwable object, boolean child) {
        if (object instanceof CompilationFailedException) {
            report((CompilationFailedException) object, child);
        } else if (object instanceof GroovyExceptionInterface) {
            report((GroovyExceptionInterface) object, child);
        } else if (object instanceof GroovyRuntimeException) {
            report((GroovyRuntimeException) object, child);
        } else if (object instanceof Exception) {
            report((Exception) object, child);
        } else {
            report(object, child);
        }

    }
761401
public RedwoodConfiguration handler(final LogRecordHandler parent, final LogRecordHandler child){
    tasks.add(new Runnable() { public void run() { Redwood.appendHandler(parent, child);} });
    return this;
  }
893479
def printJobChildren(self):
        """"""
        for job in self.jobsToReport:
            children = "CHILDREN_OF_JOB:%s " % job
            for level, jobList in enumerate(job.stack):
                for childJob in jobList:
                    children += "\t(CHILD_JOB:%s,PRECEDENCE:%i)" % (childJob, level)
            print(children)
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()
869130
public function process(array &$job)
    {
        $this->job = &$job;

        $options = $this->job['data']['options'];
        $options['limit'] = array($this->job['done'], $this->job['data']['limit']);

        $items = (array) $this->product->getList($options);

        foreach ($items as $product) {
            $data = $this->prepare($product);
            gplcart_file_csv($this->job['data']['file'], $data, $this->job['data']['delimiter']);
        }

        if (empty($items)) {
            $this->job['status'] = false;
            $this->job['done'] = $this->job['total'];
        } else {
            $this->job['done'] += count($items);
        }
    }
808727
protected function job(): void
    {
        while (true) {

            $roles = $this->retrieve([
                'corporation_id' => $this->getCorporationId(),
            ]);

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

            collect($roles)->each(function ($role) {

                collect($role->old_roles)->each(function ($role_id) use ($role) {

                    CorporationRoleHistory::firstOrNew([
                        'corporation_id' => $this->getCorporationId(),
                        'character_id'   => $role->character_id,
                        'changed_at'     => carbon($role->changed_at),
                        'role_type'      => $role->role_type,
                        'state'          => 'old',
                        'role'           => $role_id,
                    ])->fill([
                        'issuer_id' => $role->issuer_id,
                    ])->save();

                });

                collect($role->new_roles)->each(function ($role_id) use ($role) {

                    CorporationRoleHistory::firstOrNew([
                        'corporation_id' => $this->getCorporationId(),
                        'character_id'   => $role->character_id,
                        'changed_at'     => carbon($role->changed_at),
                        'role_type'      => $role->role_type,
                        'state'          => 'new',
                        'role'           => $role_id,
                    ])->fill([
                        'issuer_id' => $role->issuer_id,
                    ])->save();

                });

            });

            if (! $this->nextPage($roles->pages))
                break;
        }
    }
221435
public function process()
    {
        parent::process();

        foreach ($this->children as $child) {
            if ($child !== null && !$child->isProcessed()) {
                $child->process();
            }
        }
    }
622287
public function process()
    {
        foreach ($this->jobs as $id => $job) {
            // process the job
            $this->resolveJob($job['job'], json_encode($job['data']))->fire();
            // remove it from the processing queue
            unset($this->jobs[$id]);
        }
    }
1284323
def worker(job):
    """"""
    if job is EndOfQueue:
        return

    if not isinstance(job, JobMessage):
        print("Warning: Job should be communicated using `JobMessage`.",
              file=sys.stderr)

    key, node = job
    return run_job(key, node)
969730
def handle(self, *args, **options):
        
        verbosity = int(options.get('verbosity', 1))
        timeout = options.get('timeout')
        queue = get_queue(options.get('queue'))
        job = queue.enqueue_call(args[0], args=args[1:], timeout=timeout)
        if verbosity:
            print('Job %s created' % job.id)
154804
private void processChildTasks(Task task, MapRow row) throws IOException
   {
      List<MapRow> tasks = row.getRows("TASKS");
      if (tasks != null)
      {
         for (MapRow childTask : tasks)
         {
            processTask(task, childTask);
         }
      }
   }
865847
def process_job(job, options = {}, report_email = nil, postback_url = nil, binary_key = nil)
      data = options
      data['job'] = job
      if !report_email.nil?
        data['report_email'] = report_email
      end

      if !postback_url.nil?
        data['postback_url'] = postback_url
      end
      api_post(:job, data, binary_key)
    end