Functions to update and report on worker status
This is the code documentation for the SproutCMS project
Search documentation |
class WorkerCtrlFunctions to update and report on worker status
Extending this class<?php /** * New class description goes here * * @author Your Name, 2024-11-25 **/ class NewClassName extends WorkerCtrl { /** * Return the status and metric values for a given worker job. * * Statuses are: * 'Prepared', 'Running', 'Success', 'Failed'. * * Returns an array of ['status', 'metric1val', 'metric2val', 'metric3val'], or NULL on error. **/ public function getStatus ($job_id) { // Method code goes here } /** * Looks in a few places for a PHP binary **/ private function findPhp () { // Method code goes here } /** * Starts a new worker * Workers are run in their own process (using the PHP CLI) * * The first argument is the class name * Additional arguments can be provided directly in the function call * * Return value is an array with the following keys * job_id The ID of the new job * log_url URL to view ongoing status and log **/ public function start (string $class_name) { // Method code goes here } } ?> |
Powered by Pelzini, version 0.9.0 |
Documentation is made available under the
GNU Free Documentation License 1.2. Generated: Monday, 3rd April, 2023 at 02:59 pm |