Documentation

Worker
in package

Functions called by worker libraries to indicate status, etc

Table of Contents

Properties

$job_id  : int
$starttime  : int
$stmt_message  : PDOStatement
$stmt_metric  : PDOStatement

Methods

exceptionHandler()  : never
Exception and error handling for worker jobs
failure()  : never
Report that a worker job failed.
message()  : void
Save and output log message for the currently running worker job
metric()  : void
Set a metric
shutdown()  : void|never
Shutdown function, for catching fatal errors
start()  : true
Called just before the worker thread is started.
success()  : never
Report the successful completion of the worker job.

Properties

$job_id

public static int $job_id

$starttime

public static int $starttime

$stmt_message

protected static PDOStatement $stmt_message

$stmt_metric

protected static PDOStatement $stmt_metric

Methods

exceptionHandler()

Exception and error handling for worker jobs

public static exceptionHandler(Throwable $exception) : never
Parameters
$exception : Throwable
Return values
never

failure()

Report that a worker job failed.

public static failure([string $message = '' ]) : never

Terminates the script.

Parameters
$message : string = ''

Optional message to be logged

Return values
never —

Terminates script

message()

Save and output log message for the currently running worker job

public static message(string $message) : void
Parameters
$message : string

The message to log

metric()

Set a metric

public static metric(int $num, int $value) : void
Parameters
$num : int

The metric index; 1, 2, or 3

$value : int

The metric value

shutdown()

Shutdown function, for catching fatal errors

public static shutdown() : void|never
Return values
void|never

start()

Called just before the worker thread is started.

public static start(int $job_id) : true
Parameters
$job_id : int
Tags
throws
Exception
Return values
true

success()

Report the successful completion of the worker job.

public static success() : never

Terminates the script.

Return values
never —

Terminates script

On this page

Search results