Helios::JobType - class to represent Helios jobtypes
# use the lookup() class method to retrieve jobtypes # from the Helios collective database my $jobtype = Helios::JobType->lookup(name => 'Helios::TestService'); --OR-- my $jobtype = Helios::JobType->lookup(jobtypeid => 1); print "Name: ", $jobtype->getName, " Jobtypeid: ", $jobtype->getJobtypeid,"\n"; # use new() and create() to create new jobtypes my $newtype = Helios::JobType->new( name => 'NewJobType' ); $newtype->create(); print "Created jobtype ",$newtype->getJobtypeid,"\n";
Objects of the Helios::JobType class represent jobtypes in the Helios job processing system. Every job has a jobtype, which is roughly analogous to the queue a job is in. Usually, a jobtype's name is the same as the Helios service that will be running the job, in effect creating a single queue for each Helios service. In certain advanced configurations, Helios services can be configured to service jobs of several jobtypes.
set/getName name of the jobtype in the Helios database set/getJobtypeid jobtypeid in the Helios database set/getConfig config hash to use set/getDriver Data::ObjectDriver to Helios database
Creates a new Helios::JobType object. If parameters are passed, calls init() with those parameters to initialize the object's values.
If any parameters are passed to new(), init() will be called to further initialize the object.
If an elemental object is passed to new() or init() using the 'obj' parameter, _inflate() will be called to expand the elemental object into the full Helios object.
Helios::JobType objects can be inflated from TheSchwartz::FuncMap objects.
Given either a jobtype name or jobtypeid, the lookup method will attempt to find a jobtype matching that criteria in the collective database and returns a Helios::JobType object representing that jobtype to the calling routine. If a matching jobtype is not found, undef is returned.
THROWS: Helios::Error::JobTypeError if a problem occurs querying the Helios database.
Given a jobtype name, create() creates a jobtype with that name in the Helios collective database and returns the new jobtype's jobtypeid.
If the jobtype's name is not specified, the value returned by getName() will be used.
THROWS: Helios::Error::JobTypeError if the JobType creation fails.
The remove() method deletes a jobtype from the Helios collective database. It returns 1 if successful and throws a Helios::Error::JobTypeError if the removal operation fails.
USE WITH CAUTION. All Helios jobs, both enqueued and completed, have an associated jobtype, and removing a jobtype that still has associated jobs in the system will have unintended consequences!
THROWS: Helios::Error::JobTypeError if the removal operation fails.
Helios, Helios::Service, Helios::Job
Andrew Johnson, <lajandy at cpan dot org>
Copyright (C) 2013-4 by Logical Helion, LLC.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.0 or, at your option, any later version of Perl 5 you may have available.
This software comes with no warranty of any kind.
To install Helios, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Helios
CPAN shell
perl -MCPAN -e shell install Helios
For more information on module installation, please visit the detailed CPAN module installation guide.