SproutCMS

This is the code documentation for the SproutCMS project

Page options:

Inherited members

class WorkerCtrl

Functions to update and report on worker status

Functions

NameVisibilityDescription
findPhpprivate (static)Looks in a few places for a PHP binary
getStatuspublic (static)Return the status and metric values for a given worker job.
startpublic (static)Starts a new worker

private findPhp

unknown WorkerCtrl::findPhp ( );

Looks in a few places for a PHP binary

public getStatus

unknown WorkerCtrl::getStatus ( mixed $job_id );

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 start

array WorkerCtrl::start ( string $class_name );

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