1.3. gearman.admin_client — Gearman Admin client

class gearman.admin_client.GearmanAdminClient(host_list=None, poll_timeout=10.0)[source]

GearmanAdminClient :: Interface to send/receive administrative commands to a Gearman server

This client acts as a BLOCKING client and each call will poll until it receives a satisfactory server response

http://gearman.org/index.php?id=protocol See section ‘Administrative Protocol’

1.3.1. Interacting with a server

GearmanAdminClient.send_maxqueue(task, max_size)[source]

Sends a request to change the maximum queue size for a given task


Sends a request to shutdown the connected gearman server


Retrieves a list of all registered tasks and reports how many items/workers are in the queue


Retrieves the version number of the Gearman server


Retrieves a list of workers and reports what tasks they’re operating on

Checking server state:

gm_admin_client = gearman.GearmanAdminClient(['localhost:4730'])

# Inspect server state
status_response = gm_admin_client.get_status()
version_response = gm_admin_client.get_version()
workers_response = gm_admin_client.get_workers()

1.3.2. Testing server response times


Sends off a debugging string to execute an application ping on the Gearman server

Checking server response time:

gm_admin_client = gearman.GearmanAdminClient(['localhost:4730'])
response_time = gm_admin_client.ping_server()