ZendAPI_Queue
class ZendAPI_Queue (View source)
Properties
$_jobqueue_url |
Methods
Constructor for a job queue connection
Open a connection to a job queue
Insert a new job to the queue, the Job is passed by reference because its new job ID and status will be set in the Job object If the returned job id is 0 it means the job could be added to the queue
Return a Job object that describing a job in the queue
Update an existing job in the queue with it's new properties. If job doesn't exists, a new job will be added. Job is passed by reference and it's updated from the queue.
Remove a job from the queue
Suspend a job in the queue (without removing it)
Resume a suspended job in the queue
Requeue failed job back to the queue.
returns job statistics
Returns whether a script exists in the document root
Returns whether the queue is suspended
Return a list of jobs in the queue according to the options given in the filter_options parameter, doesn't return jobs in "final states" (failed, complete) If application id is set for this queue, only jobs with this application id will be returned
Return the number of jobs in the queue according to the options given in the filter_options parameter
Return all the hosts that jobs were submitted from.
Return all the application ids exists in queue.
Return finished jobs (either failed or successed) between time range allowing paging.
Suspends queue operation
Resumes queue operation
Return description of the last error occurred in the queue object. After every method invoked an error string describing the error is store in the queue object.
Sets a new maximum time for keeping historic jobs
Details
ZendAPI_Queue
zendapi_queue(string $queue_url)
Constructor for a job queue connection
bool
login(string $password, int $application_id = null)
Open a connection to a job queue
int
addJob(Job $job)
Insert a new job to the queue, the Job is passed by reference because its new job ID and status will be set in the Job object If the returned job id is 0 it means the job could be added to the queue
Job
getJob(int $job_id)
Return a Job object that describing a job in the queue
int
updateJob(Job $job)
Update an existing job in the queue with it's new properties. If job doesn't exists, a new job will be added. Job is passed by reference and it's updated from the queue.
bool
removeJob(int|int[] $job_id)
Remove a job from the queue
bool
suspendJob(int|int[] $job_id)
Suspend a job in the queue (without removing it)
bool
resumeJob(int|int[] $job_id)
Resume a suspended job in the queue
bool
requeueJob(Job $job)
Requeue failed job back to the queue.
array
getStatistics()
returns job statistics
bool
isScriptExists(string $path)
Returns whether a script exists in the document root
bool
isSuspend()
Returns whether the queue is suspended
array
getJobsInQueue(array $filter_options = null, int $max_jobs = -1, bool $with_globals_and_output = false)
Return a list of jobs in the queue according to the options given in the filter_options parameter, doesn't return jobs in "final states" (failed, complete) If application id is set for this queue, only jobs with this application id will be returned
int
getNumOfJobsInQueue(array $filter_options = null)
Return the number of jobs in the queue according to the options given in the filter_options parameter
array
getAllhosts()
Return all the hosts that jobs were submitted from.
array
getAllApplicationIDs()
Return all the application ids exists in queue.
array
getHistoricJobs(int $status, int $start_time, int $end_time, int $index, int $count, int $total)
Return finished jobs (either failed or successed) between time range allowing paging.
Jobs are sorted by job id descending.
bool
suspendQueue()
Suspends queue operation
bool
resumeQueue()
Resumes queue operation
string
getLastError()
Return description of the last error occurred in the queue object. After every method invoked an error string describing the error is store in the queue object.
bool
setMaxHistoryTime()
Sets a new maximum time for keeping historic jobs