gearman_return_t - Gearmand Documentation,
http://gearman.info/
#include <libgearman/gearman.h>
Compile and link with -lgearman
gearman_return_t is used as a return/error type for all
calls using gearman_client_st and gearman_worker_st.
GEARMAN_SUCCESS is returned upon success, otherwise an error is
returned. gearman_failed() can be used to see if the return value is
a failing value. You can print a text version of the error message with
gearman_strerror().
gearman_success() return true if GEARMAN_SUCCESS or
if GEARMAN_NO_PENDING_TASKS tests true.
gearman_failed() return true if any value other then
GEARMAN_SUCCESS was provided.
gearman_continue() returns true if any error related to
non-blocking IO occurred. This should be used for testing loops.
- GEARMAN_IO_WAIT
- Blocking IO was found. gearman_continue() can be used to test for
this.
- GEARMAN_ERRNO
- System error occurred. Use either gearman_client_errno() or
gearman_worker_errno()
- GEARMAN_NO_ACTIVE_FDS
- No active connections were available. gearman_continue() can be used to
test for this.
- GEARMAN_ECHO_DATA_CORRUPTION
- Either gearman_client_echo() or gearman_worker_echo() echo
was unsuccessful because the data was returned from gearmand
corrupted.
- GEARMAN_INVALID_ARGUMENT
- One of the arguments to the given API call was invalid. EINVAL will be set
if gearman_client_error() or gearman_worker_error() were not
settable. This can also be returned if
GEARMAN_CLIENT_UNBUFFERED_RESULT was set, but the client is not
handling the data correctly.
- GEARMAN_NEED_WORKLOAD_FN
- A client was asked for work, but no gearman_workload_fn callback
was specified. See gearman_client_set_workload_fn()
- GEARMAN_WORK_FAIL
- A task has failed, and the worker has exited with an error or it called
gearman_job_send_fail()
- GEARMAN_IN_PROGRESS
- gearman_client_job_status() has been called for a
gearman_job_handle_t and the Job is currently being run by a
worker.
- GEARMAN_JOB_EXISTS
- gearman_client_job_status() has been called for a
gearman_job_handle_t and the Job is currently known by a server,
but is not being run by a worker.
- GEARMAN_NO_JOBS
- No jobs were found for the worker. This error code is only returned if the
worker has just made a request for jobs.
WORKER TO CLIENT
Client which have registered a custom gearman_actions_t may
use these value as return values to the calling client.
- GEARMAN_WORK_DATA
- Worker has sent a chunked piece of data to the client via
gearman_job_send_data()
- GEARMAN_WORK_FAIL
- A task has failed, and the worker has exited with an error or it called
gearman_job_send_fail()
- GEARMAN_PAUSE
- Used only in custom application for client return based on
GEARMAN_WORK_DATA, GEARMAN_WORK_WARNING,
GEARMAN_WORK_EXCEPTION, GEARMAN_WORK_FAIL, or
GEARMAN_WORK_STATUS. gearman_continue() can be used to check
for this value.
WORKER TO CLIENT
Any function defined by gearman_worker_define_function()
may, and can only, return the following gearman_return_t values.
- GEARMAN_FAIL
- The function failed to complete the job. GEARMAN_FATAL is the
deprecated name for GEARMAN_FAIL
- GEARMAN_SHUTDOWN
- GEARMAN_SHUTDOWN is a special case. If it is returned the client
will be sent GEARMAN_SUCCESS, but gearman_worker_work() will
exit with GEARMAN_SHUTDOWN.
If any of these errors occurred the connection will be
dropped/reset.
Data Differential http://www.datadifferential.com/
2011-2019, Data Differential, http://www.datadifferential.com/