#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 <#c.gearman_client_st> and
gearman_worker_st <#c.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.
- type
GEARMAN_NO_PENDING_TASKS
- gearman_client_run_tasks() <#c.gearman_client_run_tasks> was
called and it has completed all tasks assigned to the client.
- type
GEARMAN_ERRNO
- System error occurred. Use either gearman_client_errno()
<#c.gearman_client_errno> or gearman_worker_errno()
<#c.gearman_worker_errno>
- type
GEARMAN_ECHO_DATA_CORRUPTION
- Either gearman_client_echo() <#c.gearman_client_echo> or
gearman_worker_echo() <#c.gearman_worker_echo> echo was
unsuccessful because the data was returned from gearmand
corrupted.
- type
GEARMAN_INVALID_ARGUMENT
- One of the arguments to the given API call was invalid. EINVAL will be set
if gearman_client_error() <#c.gearman_client_error> or
gearman_worker_error() <#c.gearman_worker_error> were not
settable. This can also be returned if
GEARMAN_CLIENT_UNBUFFERED_RESULT
<#c.GEARMAN_CLIENT_UNBUFFERED_RESULT> was set, but the client is not
handling the data correctly.
- type
GEARMAN_NEED_WORKLOAD_FN
- A client was asked for work, but no gearman_workload_fn
<#c.gearman_workload_fn> callback was specified. See
gearman_client_set_workload_fn()
<#c.gearman_client_set_workload_fn>
- type
GEARMAN_WORK_FAIL
- A task has failed, and the worker has exited with an error or it called
gearman_job_send_fail() <#c.gearman_job_send_fail>
- type
GEARMAN_IN_PROGRESS
- gearman_client_job_status() <#c.gearman_client_job_status>
has been called for a gearman_job_handle_t
<#c.gearman_job_handle_t> and the Job is currently being run by a
worker.
- type
GEARMAN_JOB_EXISTS
- gearman_client_job_status() <#c.gearman_client_job_status>
has been called for a gearman_job_handle_t
<#c.gearman_job_handle_t> and the Job is currently known by a
server, but is not being run by a worker.
- type
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
<#c.gearman_actions_t> may use these value as return values to the
calling client.
- type
GEARMAN_WORK_DATA
- Worker has sent a chunked piece of data to the client via
gearman_job_send_data() <#c.gearman_job_send_data>
- type
GEARMAN_WORK_WARNING
- Worker has issued a warning to the client via
gearman_job_send_warning() <#c.gearman_job_send_warning>
- type
GEARMAN_WORK_STATUS
- Status has been updated by the worker via gearman_job_send_status()
<#c.gearman_job_send_status>
- type
GEARMAN_WORK_FAIL
- A task has failed, and the worker has exited with an error or it called
gearman_job_send_fail() <#c.gearman_job_send_fail>
- type
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()
<#c.gearman_worker_define_function> may, and can only, return the
following gearman_return_t values.
- type
GEARMAN_FAIL
- The function failed to complete the job. GEARMAN_FATAL is the
deprecated name for GEARMAN_FAIL
- type
GEARMAN_SHUTDOWN
- GEARMAN_SHUTDOWN is a special case. If it is returned the client
will be sent GEARMAN_SUCCESS, but gearman_worker_work()
<#c.gearman_worker_work> will exit with
GEARMAN_SHUTDOWN.
- type
GEARMAN_NOT_FLUSHING
- gearman_task_send_workload() <#c.gearman_task_send_workload>
failed, it was not in the correct state.
If any of these errors occurred the connection will be
dropped/reset.
Data Differential http://www.datadifferential.com/
2011-2014, Data Differential, http://www.datadifferential.com/