52 parent::__construct(
'null',
$params );
53 if ( !isset( $this->params[
'lives'] ) ) {
54 $this->params[
'lives'] = 1;
56 if ( !isset( $this->params[
'usleep'] ) ) {
57 $this->params[
'usleep'] = 0;
59 $this->removeDuplicates = !empty( $this->params[
'removeDuplicates'] );
62 public function run() {
63 if ( $this->params[
'usleep'] > 0 ) {
64 usleep( $this->params[
'usleep'] );
66 if ( $this->params[
'lives'] > 1 ) {
70 JobQueueGroup::singleton()->push(
$job );
Class to both describe a background job and handle jobs.
array $params
Array of job parameters.
Degenerate job that does nothing, but can optionally replace itself in the queue and/or sleep for a b...
__construct(array $params)
Interface for generic jobs only uses the parameters field and are JSON serializable.
if(count( $args)< 1) $job