Pass the results of the of the job to Eyewitness to record.

@return void
433957
public function recordEventFinish()
    {
        if (is_null($this->history)) {
            return;
        }

        $this->history->time_to_run = $this->calculateRunTime();
        $this->history->exitcode = $this->exitcode;
        $this->history->output = $this->retrieveOutput();
        $this->history->save();
    }
1006475
protected function job(): void
    {
        $history = $this->retrieve([
            'corporation_id' => $this->getCorporationId(),
        ]);

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

        collect($history)->each(function ($alliance) {

            CorporationAllianceHistory::firstOrNew([
                'corporation_id' => $this->getCorporationId(),
                'record_id'      => $alliance->record_id,
            ])->fill([
                'start_date'  => carbon($alliance->start_date),
                'alliance_id' => $alliance->alliance_id ?? null,
                'is_deleted'  => $alliance->is_deleted ?? false,
            ])->save();

        });
    }
949118
public function show($queue_id, $job_id)
    {
        $queue = Queue::findOrFail($queue_id);
        $job = $this->eye->queue()->getFailedJob($job_id);

        return view('eyewitness::queue.failed_job')->withJob($job)->withQueue($queue);
    }
164021
protected function job(): void
    {
        while (true) {

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

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

            collect($medals)->each(function ($medal) {

                CorporationMedal::firstOrNew([
                    'corporation_id' => $this->getCorporationId(),
                    'medal_id'       => $medal->medal_id,
                ])->fill([
                    'title'       => $medal->title,
                    'description' => $medal->description,
                    'creator_id'  => $medal->creator_id,
                    'created_at'  => carbon($medal->created_at),
                ])->save();

            });

            if (! $this->nextPage($medals->pages))
                break;
        }
    }
1014601
protected function processResults()
    {
        try {
            $this->log("Processing new result set.", Project::MSG_VERBOSE);

            $formatters = $this->getConfiguredFormatters();

            while ($row = $this->statement->fetch($this->fetchMode)) {
                foreach ($formatters as $formatter) {
                    $formatter->processRow($row);
                }
            }
        } catch (Exception $x) {
            $this->log("Error processing reults: " . $x->getMessage(), Project::MSG_ERR);
            foreach ($formatters as $formatter) {
                $formatter->close();
            }
            throw $x;
        }
    }
254788
public function renderResults()
    {
        if (!$this->results && $this->query) {
            $this->performSearch();
        }

        if (!$this->outputController) {
            return user_error('Call renderResults() on a DocumentationViewer instance.', E_USER_ERROR);
        }
        
        $request = $this->outputController->getRequest();
        $data = $this->getSearchResults($request);
        $templates = array('DocumentationViewer_search');

        if ($request->requestVar('format') && $request->requestVar('format') == "atom") {
            // alter the fields for the opensearch xml.
            $title = ($title = $this->getTitle()) ? ' - '. $title : "";
            
            $link = Controller::join_links(
                $this->outputController->Link(),
                'DocumentationOpenSearchController/description/'
            );
            
            $data->setField('Title', $data->Title . $title);
            $data->setField('DescriptionURL', $link);
            
            array_unshift($templates, 'OpenSearchResults');
        }
        
        return $this->outputController->customise($data)->renderWith($templates);
    }
584005
public function perform()
	{
		try {
			Resque_Event::trigger('beforePerform', $this);

			$instance = $this->getInstance();
			if(method_exists($instance, 'setUp')) {
				$instance->setUp();
			}

			$instance->perform();

			if(method_exists($instance, 'tearDown')) {
				$instance->tearDown();
			}

			Resque_Event::trigger('afterPerform', $this);
		}
		// beforePerform/setUp have said don't perform this job. Return.
		catch(Resque_Job_DontPerform $e) {
			return false;
		}

		return true;
	}
291897
def _save_results(self):
        """"""
        with open(self.results_file, 'w') as results_file:
            json.dump(self.results, results_file)
1241112
private void submitResults(Object task, Object results) throws JobExecutionException {
    synchronized (monitor) {
      this.job.submitTaskResults(task, results, monitor);
    }
  }
313235
public function perform()
    {
        $instance = $this->getInstance();
        try {
            Event::trigger('beforePerform', $this);

            if(method_exists($instance, 'setUp')) {
                $instance->setUp();
            }

            $instance->perform();

            if(method_exists($instance, 'tearDown')) {
                $instance->tearDown();
            }

            Event::trigger('afterPerform', $this);
        }
        // beforePerform/setUp have said don't perform this job. Return.
        catch(DontPerform $e) {
            return false;
        }

        return true;
    }
805789
protected function __save()
    {
        foreach($this->records as $record)
        {
            $content = $this->getLogString($record);
            if($this->length > 0)
            {
                $content = mb_substr($content, 0, $this->length) . '...';
            }
            echo $content, PHP_EOL;
        }
    }
674
protected function job(): void
    {
        CorporationDivision::where('corporation_id', $this->getCorporationId())->get()
            ->each(function ($division) {

                // retrieve last known entry for the current division and active corporation
                $last_known_entry = CorporationWalletJournal::where('corporation_id', $this->getCorporationId())
                                                            ->where('division', $division->division)
                                                            ->orderBy('date', 'desc')
                                                            ->first();

                $this->last_known_entry_id = is_null($last_known_entry) ? 0 : $last_known_entry->id;

                // Perform a journal walk backwards to get all of the
                // entries as far back as possible. When the response from
                // ESI is empty, we can assume we have everything.
                while (true) {

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

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

                    $entries = collect($journal);

                    // If we have no more entries, break the loop.
                    if ($entries->count() === 0)
                        break;

                    $entries->chunk(1000)->each(function ($chunk) use ($division) {

                        // if we've reached the last known entry - abort the process
                        if ($this->at_last_entry)
                            return false;

                        // if we have reached the last known entry, exclude all entries which are lower or equal to the
                        // last known entry and flag the reached status.
                        if ($chunk->where('id', $this->last_known_entry_id)->isNotEmpty()) {
                            $chunk = $chunk->where('id', '>', $this->last_known_entry_id);

                            $this->at_last_entry = true;
                        }

                        $records = $chunk->map(function ($entry, $key) use ($division) {

                            return [
                                'corporation_id'  => $this->getCorporationId(),
                                'division'        => $division->division,
                                'id'              => $entry->id,
                                'date'            => carbon($entry->date),
                                'ref_type'        => $entry->ref_type,
                                'first_party_id'  => $entry->first_party_id ?? null,
                                'second_party_id' => $entry->second_party_id ?? null,
                                'amount'          => $entry->amount ?? null,
                                'balance'         => $entry->balance ?? null,
                                'reason'          => $entry->reason ?? null,
                                'tax_receiver_id' => $entry->tax_receiver_id ?? null,
                                'tax'             => $entry->tax ?? null,
                                // introduced in v4
                                'description'     => $entry->description,
                                'context_id'      => $entry->context_id ?? null,
                                'context_id_type' => $entry->context_id_type ?? null,
                                'created_at'      => carbon(),
                                'updated_at'      => carbon(),
                            ];
                        });

                        CorporationWalletJournal::insertIgnore($records->toArray());
                    });

                    // in case the last known entry has been reached or we non longer have pages, terminate the job.
                    if (! $this->nextPage($journal->pages) || $this->at_last_entry)
                        break;
                }

                // Reset the page for the next wallet division.
                $this->page = 1;

                // Reset the last known entry for the next wallet division.
                $this->last_known_entry_id = 0;

                // Reset the last known entry status for the next wallet division.
                $this->at_last_entry = false;
            });
    }
1318925
public function job_complete($handle, $job, $result) {

        $this->log("($handle) Completed Job: $job", GearmanManager::LOG_LEVEL_WORKER_INFO);

        $this->log_result($handle, $result);
    }
766491
protected function Perform()
    {
        $bSuccess = true;

        $this->PreArticleListHandling();
        $this->HandleArticleList();
        $this->PostArticleListHandling();

        return $bSuccess;
    }
129387
public function execute() {
        global $DB;

        $timenow = time();

        \core\session\manager::gc();

        // Cleanup old session linked tokens.
        // Deletes the session linked tokens that are over a day old.
        $DB->delete_records_select('external_tokens', 'lastaccess < :onedayago AND tokentype = :tokentype',
                        array('onedayago' => $timenow - DAYSECS, 'tokentype' => EXTERNAL_TOKEN_EMBEDDED));
    }
975739
protected function makeRanking () : void
    {
        $result = [];

        // Calculate ranking
        $challenge = array ();
        $rank = 1;
        $done = 0;

        foreach ($this->_Comparison as $candidate_key => $candidate_data) :
            $challenge[$candidate_key] = $candidate_data[$this->_countType];
        endforeach;

        while ($done < $this->_selfElection->countCandidates()) :
            $looking = $this->looking($challenge);

            foreach ($challenge as $candidate => $value) :
                if ($value === $looking) :
                    $result[$rank][] = $candidate;

                    $done++;
                    unset($challenge[$candidate]);
                endif;
            endforeach;

            $rank++;
        endwhile;

        $this->_Result = $this->createResult($result);
    }
671433
public function pass() {
    if ($this->output && !$this->output->isQuiet()) {
      $this->output->write(".");
    }
    $this->passed += 1;
  }