GEARMAN_FAILED(3)

πŸ’– NAME πŸ’–

okay so bestie, this one is gearman_failed β€” part of the GEARMAN_FAILED(3) manual page, aka the Gearmand Documentation, which lives over at http://gearman.info/ πŸ¦‹


✨ SYNOPSIS ✨

#include <libgearman/gearman.h>

type gearman_return_t

const char *gearman_strerror(gearman_return_t rc)

bool gearman_success(gearman_return_t rc)

bool gearman_failed(gearman_return_t rc)

bool gearman_continue(gearman_return_t rc)

and when you build, you compile and link with -lgearman 🫢 (do not forget the link flag, she will not link herself)


🌸 DESCRIPTION 🌸

gearman_return_t is the return/error type for literal every single call you make with gearman_client_st and gearman_worker_st. When things go right you get GEARMAN_SUCCESS back, and when they don't, you get an error instead. 😭

  • gearman_failed() β€” use this to see if the return value is a failing value, i.e. it's giving "something went wrong".
  • gearman_strerror() β€” use this to print a text version of the error message, so you actually know what happened instead of just vibing with a mystery number.

Then the vibe check trio, fr fr:

  • gearman_success() returns true if GEARMAN_SUCCESS, or if GEARMAN_NO_PENDING_TASKS tests true. βœ…
  • gearman_failed() returns true if any value other than GEARMAN_SUCCESS was provided. πŸ’€
  • gearman_continue() returns true if any error related to non-blocking IO occurred. This one is the one you use for testing loops β€” no cap, that's literally its whole job.

πŸŽ€ Possible values of gearman_return_t: πŸŽ€

  • GEARMAN_SUCCESS β€” success, the moment we all live for ✨
  • GEARMAN_NO_PENDING_TASKS β€” gearman_client_run_tasks() was called and it has completed all tasks assigned to the client. she's done, she's finished, periodt πŸ’…
  • GEARMAN_IO_WAIT β€” blocking IO was found. gearman_continue() can be used to test for this. πŸ‘€
  • GEARMAN_ERRNO β€” a 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_GETADDRINFO β€” name resolution failed for a host. 😡
  • GEARMAN_NO_SERVERS β€” no servers have been provided for the client/worker. she's alone in the group chat 😭
  • GEARMAN_LOST_CONNECTION β€” connection was lost to the given server. it's giving ghosted πŸ‘»
  • GEARMAN_MEMORY_ALLOCATION_FAILURE β€” memory allocation failed. πŸ’€
  • GEARMAN_SERVER_ERROR β€” an error occurred on the server.
  • GEARMAN_NOT_CONNECTED β€” client/worker is not currently connected to the server.
  • GEARMAN_COULD_NOT_CONNECT β€” server name was valid, but a connection could not be made. so close yet so far 🌧️
  • GEARMAN_ECHO_DATA_CORRUPTION β€” either gearman_client_echo() or gearman_worker_echo() echo was unsuccessful because the data was returned from gearmand corrupted. 🚩
  • GEARMAN_UNKNOWN_STATE β€” the gearman_return_t was never set. mystery era πŸ™ˆ
  • GEARMAN_FLUSH_DATA β€” internal state, should never be seen by either client or worker. do not perceive her 🫣
  • GEARMAN_SEND_BUFFER_TOO_SMALL β€” send buffer was too small.
  • GEARMAN_TIMEOUT β€” a timeout occurred when making a request to the server. ⏰
  • GEARMAN_ARGUMENT_TOO_LARGE β€” argument was too large for the current buffer.
  • 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. 🚨

πŸ‘‘ CLIENT ONLY πŸ‘‘

  • 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. she's busy bestie πŸƒβ™€οΈ
  • 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.

🧚 WORKER ONLY 🧚

  • GEARMAN_INVALID_FUNCTION_NAME β€” a worker was sent a request for a job that it did not have a valid function for. wrong number energy πŸ“΅
  • GEARMAN_INVALID_WORKER_FUNCTION β€” no callback was provided by the worker for a given function.
  • GEARMAN_NO_REGISTERED_FUNCTION β€” a request for removing a given function from a worker was invalid since that function did not exist.
  • GEARMAN_NO_REGISTERED_FUNCTIONS β€” the worker has not registered any functions. not one. zero. nada. 😢
  • 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 πŸ’…

Clients which have registered a custom gearman_actions_t may use these values as return values to the calling client. iykyk πŸŽ€

  • GEARMAN_WORK_DATA β€” worker has sent a chunked piece of data to the client via gearman_job_send_data(). πŸ“¦
  • GEARMAN_WORK_WARNING β€” worker has issued a warning to the client via gearman_job_send_warning(). ⚠️
  • GEARMAN_WORK_STATUS β€” status has been updated by the worker via gearman_job_send_status(). πŸ“Š
  • GEARMAN_WORK_EXCEPTION β€” worker has sent an exception the client via gearman_job_send_exception(). 😱
  • GEARMAN_WORK_FAIL β€” a task has failed, and the worker has exited with an error or it called gearman_job_send_fail(). πŸ’”
  • GEARMAN_WORK_ERROR β€” a task has had an error and will be retried. πŸ”
  • 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 πŸ’… (yes, again, she said it twice πŸ’€)

Any function defined by gearman_worker_define_function() may, and can only, return the following gearman_return_t values. that's the whole menu, no substitutions 🍽️

  • GEARMAN_SUCCESS β€” the function successfully completed the job. slay ✨
  • GEARMAN_FATAL β€” (no description given, she's just standing there 🧍)
  • GEARMAN_FAIL β€” the function failed to complete the job. GEARMAN_FATAL is the deprecated name for GEARMAN_FAIL. πŸ’€
  • GEARMAN_ERROR β€” a task has had an error and will be retried. πŸ”
  • 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. plot twist 🎭

πŸ“ TASK ONLY πŸ“

  • GEARMAN_NOT_FLUSHING β€” gearman_task_send_workload() failed, it was not in the correct state. 🚫
  • GEARMAN_DATA_TOO_LARGE β€” gearman_task_send_workload() failed, the data was too large to be sent. 🐘
  • GEARMAN_UNKNOWN_OPTION β€” default state of task return value.

🌈 PROTOCOL 🌈

bestie listen. If any of these errors occurred, the connection will be dropped/reset. no negotiating. πŸ’₯
  • GEARMAN_INVALID_MAGIC
  • GEARMAN_INVALID_COMMAND
  • GEARMAN_INVALID_PACKET
  • GEARMAN_UNEXPECTED_PACKET
  • GEARMAN_TOO_MANY_ARGS

🌧️ DEPRECATED 🌧️

  • GEARMAN_IGNORE_PACKET
  • GEARMAN_MAX_RETURN

⭐ SEE ALSO ⭐

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


πŸ‘‘ Author πŸ‘‘

Data Differential β€” http://www.datadifferential.com/

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


and that's the whole page bestie, you ate πŸ’… mwah 🫢

this was version 1.1.21+ds, dated Feb 04, 2026 β€” love that for us, see u next time βœ¨πŸŽ€

πŸ“¦ where this page comes from