% include( '/elements/header.html', 'Developer Documentation' ) %> <& /elements/menubar.html, 'Freeside Perl Modules' => $fsurl.'docs/library/FS.html', 'Complete Index' => $fsurl.'docs/library/index.html', &>
FS::queue - Object methods for queue records
use FS::queue;
$record = new FS::queue \%hash;
$record = new FS::queue { 'column' => 'value' };
$error = $record->insert;
$error = $new_record->replace($old_record);
$error = $record->delete;
$error = $record->check;
An FS::queue object represents an queued job. FS::queue inherits from FS::Record. The following fields are currently supported:
Primary key
Fully-qualified subroutine name
Job status (new, locked, or failed)
Freeform text status message
UNIX timestamp
Optional link to service (see FS::cust_svc).
Optional link to customer (see FS::cust_main).
Secure flag, 'Y' indicates that when using encryption, the job needs to be run on a machine with the private key.
For access_user that created the job
Creates a new job. To add the job to the database, see "insert".
Note that this stores the hash reference, not a distinct copy of the hash it points to. You can ask the object for a copy with the hash method.
Adds this record to the database. If there is an error, returns the error, otherwise returns false.
If any arguments are supplied, a queue_arg record for each argument is also created (see FS::queue_arg).
Delete this record from the database. Any corresponding queue_arg records are deleted as well
Replaces the OLD_RECORD with this one in the database. If there is an error, returns the error, otherwise returns false.
Checks all fields to make sure this is a valid job. If there is an error, returns the error, otherwise returns false. Called by the insert and replace methods.
Returns a list of the arguments associated with this job.
Returns the FS::cust_svc object associated with this job, if any.
Returns the FS::queue_depend objects associated with this job, if any. (Dependancies that must complete before this job can be run).
Inserts a dependancy for this job - it will not be run until the other job specified completes. If there is an error, returns the error, otherwise returns false.
When using job dependancies, you should wrap the insertion of all relevant jobs in a database transaction.
Returns the FS::queue_depend objects that associate other jobs with this job, if any. (The jobs that are waiting for this job to complete before they can run).
Deletes the other queued jobs (FS::queue objects) that are waiting for this job, if any. If there is an error, returns the error, otherwise returns false.
Updates the statustext value of this job to supplied value, in the database. If there is an error, returns the error, otherwise returns false.
Returns FS::access_user object (if any) associated with this user.
Returns nothing if not found.
$jobnums global
FS::Record, schema.html from the base documentation.