Scroll to navigation

GEARMAN_STRERROR(3) Gearmand GEARMAN_STRERROR(3)

NAME

gearman_strerror - Gearmand Documentation, http://gearman.info/

SYNOPSIS

#include <libgearman/gearman.h>






Compile and link with -lgearman

DESCRIPTION

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.

Possible values of gearman_return_t:

Success

gearman_client_run_tasks() was called and it has completed all tasks assigned to the client.

Blocking IO was found. gearman_continue() can be used to test for this.

System error occurred. Use either gearman_client_errno() or gearman_worker_errno()

No active connections were available. gearman_continue() can be used to test for this.

Name resolution failed for a host.

No servers have been provided for the client/worker.

Connection was lost to the given server.

Memory allocation failed.

An error occurred on the server.

Client/Worker is not currently connected to the server.

Server name was valid, but a connection could not be made.

Either gearman_client_echo() or gearman_worker_echo() echo was unsuccessful because the data was returned from gearmand corrupted.

The gearman_return_t was never set.

Internal state, should never be seen by either client or worker.

Send buffer was too small.

A timeout occurred when making a request to the server.

Argument was too large for the current buffer.

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.

CLIENT ONLY

A client was asked for work, but no gearman_workload_fn callback was specified. See gearman_client_set_workload_fn()

A task has failed, and the worker has exited with an error or it called gearman_job_send_fail()

gearman_client_job_status() has been called for a gearman_job_handle_t and the Job is currently being run by a worker.

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.

WORKER ONLY

A worker was sent a request for a job that it did not have a valid function for.

No callback was provided by the worker for a given function.

A request for removing a given function from a worker was invalid since that function did not exist.

The worker has not registered any functions.

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.

Worker has sent a chunked piece of data to the client via gearman_job_send_data()

Worker has issued a warning to the client via gearman_job_send_warning()

Status has been updated by the worker via gearman_job_send_status()

Worker has sent an exception the client via gearman_job_send_exception()

A task has failed, and the worker has exited with an error or it called gearman_job_send_fail()

A task has had an error and will be retried.

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.

The function successfully completed the job.


The function failed to complete the job. GEARMAN_FATAL is the deprecated name for GEARMAN_FAIL

A task has had an error and will be retried.

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.

TASK ONLY

gearman_task_send_workload() failed, it was not in the correct state.

gearman_task_send_workload() failed, the data was too large to be sent.

Default state of task return value.

PROTOCOL

If any of these errors occurred the connection will be dropped/reset.






DEPRECATED



SEE ALSO

gearmand(8) libgearman(3) gearman_client_error() or gearman_worker_error()

AUTHOR

Data Differential http://www.datadifferential.com/

COPYRIGHT

2011-2017, Data Differential, http://www.datadifferential.com/

August 10, 2017 1.1.17