69
69
\fI\%gearman_continue()\fP returns true if any error related to non\-blocking IO
70
70
occurred. This should be used for testing loops.
72
Possible values of \fI\%gearman_return_t\fP:
71
.SS Possible values of \fI\%gearman_return_t\fP:
81
80
.B GEARMAN_NO_PENDING_TASKS
84
82
\fBgearman_client_run_tasks()\fP was called and it has completed all tasks assigned to the client.
88
Blocking IO was found. gearman_continue() can be used to test for this.
90
Blocking IO was found. gearman_continue() can be used to
97
94
System error occurred. Use either \fBgearman_client_errno()\fP or \fBgearman_worker_errno()\fP
100
98
.B GEARMAN_NO_ACTIVE_FDS
103
100
No active connections were available. gearman_continue() can be used to test for this.
106
104
.B GEARMAN_GETADDRINFO
109
106
Name resolution failed for a host.
112
110
.B GEARMAN_NO_SERVERS
115
112
No servers have been provided for the client/worker.
118
116
.B GEARMAN_LOST_CONNECTION
121
118
Connection was lost to the given server.
124
122
.B GEARMAN_MEMORY_ALLOCATION_FAILURE
127
124
Memory allocation failed.
130
128
.B GEARMAN_SERVER_ERROR
133
130
An error occurred on the server.
136
134
.B GEARMAN_NOT_CONNECTED
136
Client/Worker is not currently connected to the server.
139
Client/Worker is not currently connected to the
143
140
.B GEARMAN_COULD_NOT_CONNECT
142
Server name was valid, but a connection could not be made.
146
Server name was valid, but a connection could not
150
146
.B GEARMAN_ECHO_DATA_CORRUPTION
148
Either \fBgearman_client_echo()\fP or \fBgearman_work_echo()\fP echo was unsuccessful because the data was returned from \fBgearmand\fP corrupted.
153
Either \fBgearman_client_echo()\fP or
154
\fBgearman_work_echo()\fP echo was unsuccessful because the data was returned from \fBgearmand\fP corrupted.
157
152
.B GEARMAN_UNKNOWN_STATE
160
154
The gearman_return_t was never set.
163
158
.B GEARMAN_FLUSH_DATA
166
160
Internal state, should never be seen by either client or worker.
169
164
.B GEARMAN_SEND_BUFFER_TOO_SMALL
172
166
Send buffer was too small.
175
170
.B GEARMAN_TIMEOUT
178
172
A timeout occurred when making a request to the server.
181
176
.B GEARMAN_ARGUMENT_TOO_LARGE
184
178
Argument was too large for the current buffer.
187
182
.B GEARMAN_INVALID_ARGUMENT
184
One of the arguments to the given API call was invalid. EINVAL will be set if \fBgearman_client_error()\fP or \fBgearman_worker_error()\fP were not settable. This can also be returned if \fBGEARMAN_CLIENT_UNBUFFERED_RESULT\fP was set, but the client is not handling the data correctly.
190
One of the arguments to the given API call was invalid. EINVAL will be set
191
if \fBgearman_client_error()\fP or \fBgearman_worker_error()\fP were
192
not settable. This can also be returned if
193
\fBGEARMAN_CLIENT_UNBUFFERED_RESULT\fP was set, but the client is not
194
handling the data correctly.
198
189
.B GEARMAN_NEED_WORKLOAD_FN
191
A client was asked for work, but no \fBgearman_workload_fn\fP callback was specified. See \fBgearman_client_set_workload_fn()\fP
201
A client was asked for work, but no \fBgearman_workload_fn\fP callback was
202
specified. See \fBgearman_client_set_workload_fn()\fP
205
195
.B GEARMAN_WORK_FAIL
208
197
A task has failed, and the worker has exited with an error or it called \fBgearman_job_send_fail()\fP
211
201
.B GEARMAN_IN_PROGRESS
214
203
\fBgearman_client_job_status()\fP has been called for a \fBgearman_job_handle_t\fP and the Job is currently being run by a worker.
217
207
.B GEARMAN_JOB_EXISTS
220
209
\fBgearman_client_job_status()\fP has been called for a \fBgearman_job_handle_t\fP and the Job is currently known by a server, but is not being run by a worker.
224
214
.B GEARMAN_INVALID_FUNCTION_NAME
227
216
A worker was sent a request for a job that it did not have a valid function for.
230
220
.B GEARMAN_INVALID_WORKER_FUNCTION
233
222
No callback was provided by the worker for a given function.
236
226
.B GEARMAN_NO_REGISTERED_FUNCTION
239
228
A request for removing a given function from a worker was invalid since that function did not exist.
242
232
.B GEARMAN_NO_REGISTERED_FUNCTIONS
245
234
The worker has not registered any functions.
248
238
.B GEARMAN_NO_JOBS
251
240
No jobs were found for the worker.
252
242
.SS WORKER TO CLIENT
254
244
Client which have registed a custom \fBgearman_actions_t\fP may use these
258
248
.B GEARMAN_WORK_DATA
261
250
Worker has sent a chunked piece of data to the client via \fBgearman_job_send_data()\fP
264
254
.B GEARMAN_WORK_WARNING
267
256
Worker has issued a warning to the client via \fBgearman_job_send_warning()\fP
270
260
.B GEARMAN_WORK_STATUS
273
262
Status has been updated by the worker via \fBgearman_job_send_status()\fP
276
266
.B GEARMAN_WORK_EXCEPTION
279
268
Worker has sent an exception the client via \fBgearman_job_send_exception()\fP
282
272
.B GEARMAN_WORK_FAIL
285
274
A task has failed, and the worker has exited with an error or it called \fBgearman_job_send_fail()\fP
288
278
.B GEARMAN_WORK_ERROR
280
A task has had an error and will be retried.
291
A task has had an error and will be retried.
297
286
Used only in custom application for client return based on \fI\%GEARMAN_WORK_DATA\fP, \fI\%GEARMAN_WORK_WARNING\fP, \fI\%GEARMAN_WORK_EXCEPTION\fP, \fI\%GEARMAN_WORK_FAIL\fP, or \fI\%GEARMAN_WORK_STATUS\fP. \fI\%gearman_continue()\fP can be used to check for this value.
298
288
.SS WORKER TO CLIENT
300
290
Any function defined by \fBgearman_worker_define_function()\fP may, and can only, return the following \fI\%gearman_return_t\fP values.
303
293
.B GEARMAN_SUCCESS
306
295
The function successfully completed the job.
312
301
The function failed to complete the job.
307
A task has had an error and will be retried.
318
A task has had an error and will be retried.
321
311
.B GEARMAN_SHUTDOWN
313
\fI\%GEARMAN_SHUTDOWN\fP is a special case. If it is returned the client will be sent \fI\%GEARMAN_SUCCESS\fP, but \fBgearman_worker_work()\fP will exit with \fI\%GEARMAN_SHUTDOWN\fP.
324
\fI\%GEARMAN_SHUTDOWN\fP is a special case. If it is returned the client
325
will be sent \fI\%GEARMAN_SUCCESS\fP, but \fBgearman_worker_work()\fP
326
will exit with \fI\%GEARMAN_SHUTDOWN\fP.
330
318
.B GEARMAN_NOT_FLUSHING
333
320
\fBgearman_task_send_workload()\fP failed, it was not in the correct state.
336
324
.B GEARMAN_DATA_TOO_LARGE
339
326
\fBgearman_task_send_workload()\fP failed, the data was too large to be sent.
342
330
If any of these errors occurred the connection will be dropped/reset.