Gearman::JobScheduler::Admin - Gearman administration utilities.
Gearman::JobScheduler::Admin
Reimplements functionality of "gearadmin" (http://bazaar.launchpad.net/~tangent-trunk/gearmand/1.2/view/head:/bin/gearadmin.cc) in Perl.
server_version($config)
Get the version number from all the configured servers.
Parameters:
Instance of Gearman::JobScheduler::Configuration
Returns hashref of configured servers and their versions, e.g.:
Returns undef on error.
undef
server_version_on_server($server)
Get the version number from a server.
Server as "host:port" (e.g. "localhost:4730")
Returns a string server version, e.g. '1.1.9'.
server_verbose($config)
Get the verbose setting from all the configured servers.
Returns hashref of configured servers and their verbosity levels, e.g.:
Available verbosity levels:
* FATAL
FATAL
* ALERT (currently unused in Gearman)
ALERT
* CRITICAL (currently unused in Gearman)
CRITICAL
* ERROR
ERROR
* WARN
WARN
* NOTICE
NOTICE
* INFO
INFO
* DEBUG
DEBUG
server_verbose_on_server($server)
Get the verbose setting from a server.
Returns string verbose setting (see server_verbose for possible values).
server_verbose
create_function($function_name, $config)
Create the function on all the configured servers.
Function name (e.g. hello_world)
hello_world
Returns true (1) if the function has been created, false (undef) on error.
create_function_on_server($function_name, $server)
Create the function on a server.
drop_function($function_name, $config)
Drop the function on all the configured servers.
Returns true (1) if the function has been dropped, false (undef) on error.
drop_function_on_server($function_name, $server)
Drop the function on a server.
show_jobs($config)
Show all jobs on all the configured servers.
Returns a hashref of servers and their jobs, e.g.:
show_jobs_on_server($server)
Show all jobs on a server.
Returns a hashref of job statuses, e.g.:
show_unique_jobs($config)
Show unique jobs on all the configured servers.
Returns an arrayref of unique job identifiers, e.g.:
show_unique_jobs_on_server($server)
Show unique jobs on a server.
cancel_job($gearman_job_id, $config)
Remove a given job from all the configured servers' queues.
Gearman job ID (e.g. "H:localhost.localdomain:8")
Returns true (1) if the job has been cancelled, false (undef) on error.
cancel_job_on_server($gearman_job_id, $server)
Remove a given job from a server's queue.
get_pid($config)
Get Process ID (PID) of all the configured servers.
Returns hashref of configured servers and their integer PIDs, e.g.:
get_pid_for_server($server)
Get Process ID (PID) of a server.
Returns integer PID (e.g. 1234).
status($config)
Get status from all the configured servers.
Returns a hashref of servers and their statuses, e.g.:
status_on_server($server)
Get status of a server.
Returns a hashref of Gearman functions and their statuses, e.g.:
workers($config)
Get a list of workers from all the configured servers.
Returns a hashref of servers and their workers, e.g.:
workers_on_server($server)
Get a list of workers on a server.
Returns an arrayref of hashrefs for each of the registered worker, e.g.:
shutdown_all_servers($config)
Shutdown all the configured servers.
Returns true (1) if the Gearman servers have been shutdown.
Returns false (undef) on error.
shutdown_server($server)
Shutdown a server.
Returns true (1) if the Gearman server has been shutdown.
To install Gearman::JobScheduler, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Gearman::JobScheduler
CPAN shell
perl -MCPAN -e shell install Gearman::JobScheduler
For more information on module installation, please visit the detailed CPAN module installation guide.