1Gearman::Server::ClientU(s3e)r Contributed Perl DocumentaGteiaornman::Server::Client(3)
2
3
4

NAME

6       Gearman::Server::Client
7

NAME

9       Used by Gearman::Server to instantiate connections from clients.
10       Clients speak either a binary protocol, for normal operation (calling
11       functions, grabbing function call requests, returning function values,
12       etc), or a text-based line protocol, for relatively rare administrative
13       / monitoring commands.
14
15       The binary protocol commands aren't currently documented. (FIXME) But
16       they're well-implemented in Gearman::Client, Gearman::Worker, and Gear‐
17       man::Client::Async, if that's any consolation.
18
19       The line-based administrative commands are documented below.
20

Binary Protocol Structure

22       All binary protocol exchanges between clients (which can be callers,
23       workers, or both) and the Gearman server have common packet header:
24
25         4 byte magic  -- either "\0REQ" for requests to the server, or
26                          "\0RES" for responses from the server
27         4 byte type   -- network order integer, representing the packet type
28         4 byte length -- network order length, for data segment.
29         data          -- optional, if length is non-zero
30

Binary Protocol Commands

32       echo_req (type=16)
33
34       A debug command.  The server will reply with the same data, in a
35       echo_res (type=17) packet.
36
37       (and many more...)
38
39       FIXME: auto-generate protocol docs from internal Gearman::Util table,
40       once annotated with some English?
41

Line based commands

43       These commands are used for administrative or statistic tasks to be
44       done on the gearman server. They can be entered using a line based
45       client (telnet, etc.) by connecting to the listening port (7003) and
46       are also intended to be machine parsable.
47
48       "workers"
49
50       Emits list of registered workers, their fds, IPs, client ids, and list
51       of registered abilities (function names they can do).  Of format:
52
53         fd ip.x.y.z client_id : func_a func_b func_c
54         fd ip.x.y.z client_id : func_a func_b func_c
55         fd ip.x.y.z client_id : func_a func_b func_c
56         .
57
58       It ends with a line with just a period.
59
60       "status"
61
62       The output format of this function is tab separated columns as follows,
63       followed by a line consisting of a fullstop and a newline (".\n") to
64       indicate the end of output.
65
66       Function name
67           A string denoting the name of the function of the job
68
69       Number in queue
70           A positive integer indicating the total number of jobs for this
71           function in the queue. This includes currently running ones as well
72           (next column)
73
74       Number of jobs running
75           A positive integer showing how many jobs of this function are cur‐
76           rently running
77
78       Number of capable workers
79           A positive integer denoting the maximum possible count of workers
80           that could be doing this job. Though they may not all be working on
81           it due to other tasks holding them busy.
82
83       "maxqueue" function [max_queue_size]
84
85       For a given function of job, the maximum queue size is adjusted to be
86       max_queue_size jobs long. A negative value indicates unlimited queue
87       size.
88
89       If the max_queue_size value is not supplied then it is unset (and the
90       default maximum queue size will apply to this function).
91
92       This function will return OK upon success, and will return ERR incom‐
93       plete_args upon an invalid number of arguments.
94
95       "shutdown" ["graceful"]
96
97       Close the server.  Or "shutdown graceful" to close the listening
98       socket, then close the server when traffic has died away.
99
100       "version"
101
102       Returns server version.
103
104
105
106perl v5.8.8                       2007-05-03        Gearman::Server::Client(3)
Impressum