1GEARMAN_FAILED(3) Gearmand GEARMAN_FAILED(3)
2
3
4
6 gearman_failed - Gearmand Documentation, http://gearman.info/
7
9 #include <libgearman/gearman.h>
10
11 type gearman_return_t
12
13 const char *gearman_strerror(gearman_return_t rc)
14
15 bool gearman_success(gearman_return_t rc)
16
17 bool gearman_failed(gearman_return_t rc)
18
19 bool gearman_continue(gearman_return_t rc)
20
21 Compile and link with -lgearman
22
24 gearman_return_t is used as a return/error type for all calls using
25 gearman_client_st and gearman_worker_st. GEARMAN_SUCCESS is returned
26 upon success, otherwise an error is returned. gearman_failed() can be
27 used to see if the return value is a failing value. You can print a
28 text version of the error message with gearman_strerror().
29
30 gearman_success() return true if GEARMAN_SUCCESS or if
31 GEARMAN_NO_PENDING_TASKS tests true.
32
33 gearman_failed() return true if any value other then GEARMAN_SUCCESS
34 was provided.
35
36 gearman_continue() returns true if any error related to non-blocking IO
37 occurred. This should be used for testing loops.
38
39 Possible values of gearman_return_t:
40 type GEARMAN_SUCCESS
41 Success
42
43 type GEARMAN_NO_PENDING_TASKS
44 gearman_client_run_tasks() was called and it has completed all
45 tasks assigned to the client.
46
47 type GEARMAN_IO_WAIT
48 Blocking IO was found. gearman_continue() can be used to test
49 for this.
50
51 type GEARMAN_ERRNO
52 System error occurred. Use either gearman_client_errno() or
53 gearman_worker_errno()
54
55 type GEARMAN_NO_ACTIVE_FDS
56 No active connections were available. gearman_continue() can be
57 used to test for this.
58
59 type GEARMAN_GETADDRINFO
60 Name resolution failed for a host.
61
62 type GEARMAN_NO_SERVERS
63 No servers have been provided for the client/worker.
64
65 type GEARMAN_LOST_CONNECTION
66 Connection was lost to the given server.
67
68 type GEARMAN_MEMORY_ALLOCATION_FAILURE
69 Memory allocation failed.
70
71 type GEARMAN_SERVER_ERROR
72 An error occurred on the server.
73
74 type GEARMAN_NOT_CONNECTED
75 Client/Worker is not currently connected to the server.
76
77 type GEARMAN_COULD_NOT_CONNECT
78 Server name was valid, but a connection could not be made.
79
80 type GEARMAN_ECHO_DATA_CORRUPTION
81 Either gearman_client_echo() or gearman_worker_echo() echo was
82 unsuccessful because the data was returned from gearmand cor‐
83 rupted.
84
85 type GEARMAN_UNKNOWN_STATE
86 The gearman_return_t was never set.
87
88 type GEARMAN_FLUSH_DATA
89 Internal state, should never be seen by either client or worker.
90
91 type GEARMAN_SEND_BUFFER_TOO_SMALL
92 Send buffer was too small.
93
94 type GEARMAN_TIMEOUT
95 A timeout occurred when making a request to the server.
96
97 type GEARMAN_ARGUMENT_TOO_LARGE
98 Argument was too large for the current buffer.
99
100 type GEARMAN_INVALID_ARGUMENT
101 One of the arguments to the given API call was invalid. EINVAL
102 will be set if gearman_client_error() or gearman_worker_error()
103 were not settable. This can also be returned if GEAR‐
104 MAN_CLIENT_UNBUFFERED_RESULT was set, but the client is not han‐
105 dling the data correctly.
106
107 CLIENT ONLY
108 type GEARMAN_NEED_WORKLOAD_FN
109 A client was asked for work, but no gearman_workload_fn callback
110 was specified. See gearman_client_set_workload_fn()
111
112 type GEARMAN_WORK_FAIL
113 A task has failed, and the worker has exited with an error or it
114 called gearman_job_send_fail()
115
116 type GEARMAN_IN_PROGRESS
117 gearman_client_job_status() has been called for a gear‐
118 man_job_handle_t and the Job is currently being run by a worker.
119
120 type GEARMAN_JOB_EXISTS
121 gearman_client_job_status() has been called for a gear‐
122 man_job_handle_t and the Job is currently known by a server, but
123 is not being run by a worker.
124
125 WORKER ONLY
126 type GEARMAN_INVALID_FUNCTION_NAME
127 A worker was sent a request for a job that it did not have a
128 valid function for.
129
130 type GEARMAN_INVALID_WORKER_FUNCTION
131 No callback was provided by the worker for a given function.
132
133 type GEARMAN_NO_REGISTERED_FUNCTION
134 A request for removing a given function from a worker was in‐
135 valid since that function did not exist.
136
137 type GEARMAN_NO_REGISTERED_FUNCTIONS
138 The worker has not registered any functions.
139
140 type GEARMAN_NO_JOBS
141 No jobs were found for the worker. This error code is only re‐
142 turned if the worker has just made a request for jobs.
143
144 WORKER TO CLIENT
145 Client which have registed a custom gearman_actions_t may use these
146 value as return values to the calling client.
147
148 type GEARMAN_WORK_DATA
149 Worker has sent a chunked piece of data to the client via gear‐
150 man_job_send_data()
151
152 type GEARMAN_WORK_WARNING
153 Worker has issued a warning to the client via gear‐
154 man_job_send_warning()
155
156 type GEARMAN_WORK_STATUS
157 Status has been updated by the worker via gearman_job_send_sta‐
158 tus()
159
160 type GEARMAN_WORK_EXCEPTION
161 Worker has sent an exception the client via gearman_job_send_ex‐
162 ception()
163
164 type GEARMAN_WORK_FAIL
165 A task has failed, and the worker has exited with an error or it
166 called gearman_job_send_fail()
167
168 type GEARMAN_WORK_ERROR
169 A task has had an error and will be retried.
170
171 type GEARMAN_PAUSE
172 Used only in custom application for client return based on
173 GEARMAN_WORK_DATA, GEARMAN_WORK_WARNING, GEARMAN_WORK_EXCEPTION,
174 GEARMAN_WORK_FAIL, or GEARMAN_WORK_STATUS. gearman_continue()
175 can be used to check for this value.
176
177 WORKER TO CLIENT
178 Any function defined by gearman_worker_define_function() may, and can
179 only, return the following gearman_return_t values.
180
181 type GEARMAN_SUCCESS
182 The function successfully completed the job.
183
184 type GEARMAN_FATAL
185
186 type GEARMAN_FAIL
187 The function failed to complete the job. GEARMAN_FATAL is the
188 deprecated name for GEARMAN_FAIL
189
190 type GEARMAN_ERROR
191 A task has had an error and will be retried.
192
193 type GEARMAN_SHUTDOWN
194 GEARMAN_SHUTDOWN is a special case. If it is returned the client
195 will be sent GEARMAN_SUCCESS, but gearman_worker_work() will
196 exit with GEARMAN_SHUTDOWN.
197
198 TASK ONLY
199 type GEARMAN_NOT_FLUSHING
200 gearman_task_send_workload() failed, it was not in the correct
201 state.
202
203 type GEARMAN_DATA_TOO_LARGE
204 gearman_task_send_workload() failed, the data was too large to
205 be sent.
206
207 type GEARMAN_UNKNOWN_OPTION
208 Default state of task return value.
209
210 PROTOCOL
211 If any of these errors occurred the connection will be dropped/reset.
212
213 type GEARMAN_INVALID_MAGIC
214
215 type GEARMAN_INVALID_COMMAND
216
217 type GEARMAN_INVALID_PACKET
218
219 type GEARMAN_UNEXPECTED_PACKET
220
221 type GEARMAN_TOO_MANY_ARGS
222
223 DEPRECATED
224 type GEARMAN_IGNORE_PACKET
225
226 type GEARMAN_MAX_RETURN
227
229 gearmand(8) libgearman(3) gearman_client_error() or gearman_worker_er‐
230 ror()
231
233 Data Differential http://www.datadifferential.com/
234
236 2011-2014, Data Differential, http://www.datadifferential.com/
237
238
239
240
2411.1.20 Nov 19, 2022 GEARMAN_FAILED(3)