GEARMAN_SUCCESS(3)
πΈ NAME πΈ
gearman_success β Gearmand Documentation, http://gearman.info/
okay bestie, welcome to GEARMAN_SUCCESS(3), the page where we vibe-check every single way a Gearman call can come back at you. This is your return-value decoder ring, and it's lowkey the most important page in the whole libgearman era. π
β¨ 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)
Compile and link with -lgearman π«Ά
π¦ DESCRIPTION π¦
So here's the tea. gearman_return_t is the return/error type for literally every call that touches gearman_client_st or gearman_worker_st. When things go right you get GEARMAN_SUCCESS, and when they don't, you get an error back instead. If you just wanna know "did this fail" without matching on every single constant, use gearman_failed(). And when you want an actual readable string to print? That's gearman_strerror()'s whole moment. β¨
gearman_success() returns true if the value is GEARMAN_SUCCESS, or if GEARMAN_NO_PENDING_TASKS tests true. Iconic double duty.
gearman_failed() returns true if any value other than GEARMAN_SUCCESS was handed to it. Full stop.
gearman_continue() returns true if any error related to non-blocking IO happened. This one is built for testing loops β it's the "keep going, babe" function. π₯
π« Possible values of gearman_return_t: π«
GEARMAN_SUCCESSβ Success. The main character. πGEARMAN_NO_PENDING_TASKSβgearman_client_run_tasks()was called and it has completed all tasks assigned to the client.GEARMAN_IO_WAITβ Blocking IO was found.gearman_continue()can be used to test for this.GEARMAN_ERRNOβ System error occurred. Use eithergearman_client_errno()orgearman_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.GEARMAN_LOST_CONNECTIONβ Connection was lost to the given server. π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.GEARMAN_ECHO_DATA_CORRUPTIONβ Eithergearman_client_echo()orgearman_worker_echo()echo was unsuccessful because the data was returned from gearmand corrupted.GEARMAN_UNKNOWN_STATEβ Thegearman_return_twas never set.GEARMAN_FLUSH_DATAβ Internal state, should never be seen by either client or worker.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.EINVALwill be set ifgearman_client_error()orgearman_worker_error()were not settable. This can also be returned ifGEARMAN_CLIENT_UNBUFFERED_RESULTwas set, but the client is not handling the data correctly.
π§ CLIENT ONLY π§
GEARMAN_NEED_WORKLOAD_FNβ A client was asked for work, but nogearman_workload_fncallback was specified. Seegearman_client_set_workload_fn()GEARMAN_WORK_FAILβ A task has failed, and the worker has exited with an error or it calledgearman_job_send_fail()GEARMAN_IN_PROGRESSβgearman_client_job_status()has been called for agearman_job_handle_tand the Job is currently being run by a worker.GEARMAN_JOB_EXISTSβgearman_client_job_status()has been called for agearman_job_handle_tand 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.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.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.
GEARMAN_WORK_DATAβ Worker has sent a chunked piece of data to the client viagearman_job_send_data()GEARMAN_WORK_WARNINGβ Worker has issued a warning to the client viagearman_job_send_warning()GEARMAN_WORK_STATUSβ Status has been updated by the worker viagearman_job_send_status()GEARMAN_WORK_EXCEPTIONβ Worker has sent an exception the client viagearman_job_send_exception()GEARMAN_WORK_FAILβ A task has failed, and the worker has exited with an error or it calledgearman_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 onGEARMAN_WORK_DATA,GEARMAN_WORK_WARNING,GEARMAN_WORK_EXCEPTION,GEARMAN_WORK_FAIL, orGEARMAN_WORK_STATUS.gearman_continue()can be used to check for this value.
yes bestie, "WORKER TO CLIENT" shows up twice on this page. not a typo on my end, that's just how the original rolls. keep scrolling. π
πΈ WORKER TO CLIENT πΈ
Any function defined by gearman_worker_define_function() may, and can only, return the following gearman_return_t values.
GEARMAN_SUCCESSβ The function successfully completed the job.GEARMAN_FATALβ (no description, it just vibes here)GEARMAN_FAILβ The function failed to complete the job.GEARMAN_FATALis the deprecated name forGEARMAN_FAILGEARMAN_ERRORβ A task has had an error and will be retried.GEARMAN_SHUTDOWNβGEARMAN_SHUTDOWNis a special case. If it is returned the client will be sentGEARMAN_SUCCESS, butgearman_worker_work()will exit withGEARMAN_SHUTDOWN.
π 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 β
If any of these errors occurred the connection will be dropped/reset. no cap, it's over.
GEARMAN_INVALID_MAGICGEARMAN_INVALID_COMMANDGEARMAN_INVALID_PACKETGEARMAN_UNEXPECTED_PACKETGEARMAN_TOO_MANY_ARGS
π DEPRECATED π
GEARMAN_IGNORE_PACKETGEARMAN_MAX_RETURN
π₯ SEE ALSO π₯
gearmand(8) libgearman(3) gearman_client_error() or gearman_worker_error()
π Author π
Data Differential http://www.datadifferential.com/
π«Ά Copyright π«Ά
2011-2014, Data Differential, http://www.datadifferential.com/
and that's the whole page bestie!! this lil masterpiece came from the Gearmand source, version 1.1.21+ds, dated Feb 04, 2026 β go forth and check your return values, you absolute icon. πβ¨π¦
π¦ where this page comes from
- ubuntu resolute: libgearman-dev 1.1.21+ds-1ubuntu3 Β· BSD-3-Clause
- ubuntu stonking: libgearman-dev 1.1.21+ds-1ubuntu3 Β· BSD-3-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms