include/SugarQueue/SugarJobQueue.php
\SugarJobQueue
Package: SugarCRM
Job queue driver
- Api
Properties
Methods
cleanup(
)
:
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 |
getJob(
string $jobId
)
:
\SugarJob
Get Job object by ID
Parameters
Returns
Name | Type | Description |
---|---|---|
$jobId | string |
Type | Description |
---|---|
\SugarJob |
nextJob(
string $clientID
)
:
\SugarJob
Fetch the next job in the queue and mark it running
Parameters
Returns
Name | Type | Description |
---|---|---|
$clientID | string | ID of the client requesting the job |
Type | Description |
---|---|
\SugarJob |
postponeJob(
string $jobId, string $message
=
null, string $delay
=
null
)
:
bool
Rerun this job again
Parameters
Returns
Name | Type | Description |
---|---|---|
$jobId | string | |
$message | string | |
$delay | string | how long to delay (default is job's delay) |
Type | Description |
---|---|
bool |
resolveJob(
string $jobId, string $resolution, string $message
=
null
)
:
bool
Resolve job as success or failure
Parameters
Returns
Name | Type | Description |
---|---|---|
$jobId | string | |
$resolution | string | One of JOB_ constants that define job status |
$message | string |
Type | Description |
---|---|
bool |