include/SugarQueue/SugarJobQueue.php

Show: inherited
Table of Contents

\SugarJobQueue

Package: SugarCRM

Job queue driver

Api
 

Properties

Propertypublic\DBManager  $db= ''

DB connection

Details
Type
\DBManager
Propertypublicint  $jobTries= '5'

Max number of failures for job

Default value5Details
Type
int
Propertyprotectedstring  $job_queue_table= ''

Table in the DB that stores jobs

Details
Type
string
Propertypublicint  $timeout= '86400'

Job running timeout - longer than that, job is failed by force

Default value86400Details
Type
int

Methods

methodpublic__construct( ) : void

methodpubliccleanQueue( ) : void

Nuke all jobs from the queue

methodpubliccleanup( ) : bool

Remove old jobs that still are marked as running

Returns
Type Description
bool true if no failed job discovered, false if some job were failed
methodpublicdeleteJob( string $jobId ) : void

Delete a job

Parameters
Name Type Description
$jobId string
methodprotectedgetJob( string $jobId ) : \SugarJob

Get Job object by ID

Parameters
Name Type Description
$jobId string
Returns
Type Description
\SugarJob
methodpublicnextJob( string $clientID ) : \SugarJob

Fetch the next job in the queue and mark it running

Parameters
Name Type Description
$clientID string

ID of the client requesting the job

Returns
Type Description
\SugarJob
methodpublicpostponeJob( string $jobId, string $message = null, string $delay = null ) : bool

Rerun this job again

Parameters
Name Type Description
$jobId string
$message string
$delay string

how long to delay (default is job's delay)

Returns
Type Description
bool
methodpublicresolveJob( string $jobId, string $resolution, string $message = null ) : bool

Resolve job as success or failure

Parameters
Name Type Description
$jobId string
$resolution string

One of JOB_ constants that define job status

$message string
Returns
Type Description
bool
methodpublicrunSchedulers( ) : void

Run schedulers to instantiate scheduled jobs

methodpublicsubmitJob( \SugarJob $job ) : void

Submit a new job to the queue

Parameters
Name Type Description
$job \SugarJob
Documentation was generated by DocBlox 0.18.1.