GEARMAN_JOB_SEND_FAIL(3)

πŸ’– GEARMAN_JOB_SEND_FAIL πŸ’–

okay bestie, welcome to the Gearmand manual, page GEARMAN_JOB_SEND_FAIL(3) 🌸 β€” yeah the filename says "send fail" but this page is actually the full job-object glow-up tour for libgearman. pull up a chair, grab a strawberry πŸ“, and let's get into it.


✨ NAME ✨

gearman_job_send_fail β€” Gearmand Documentation, <http://gearman.info/> πŸ¦‹


✨ SYNOPSIS ✨

#include <libgearman/gearman.h>

type gearman_job_st

void gearman_job_free(gearman_job_st *job)

gearman_return_t <#c.gearman_return_t>
gearman_job_send_data(gearman_job_st *job, const void *data, size_t <#c
.size_t> data_size)

gearman_return_t <#c.gearman_return_t>
gearman_job_send_warning(gearman_job_st *job, const void *warning,
size_t <#c.size_t> warning_size)

gearman_return_t <#c.gearman_return_t>
gearman_job_send_status(gearman_job_st *job, uint32_t <#c.uint32_t>
numerator, uint32_t <#c.uint32_t> denominator)

gearman_return_t <#c.gearman_return_t>
gearman_job_send_complete(gearman_job_st *job, const void *result,
size_t <#c.size_t> result_size)

gearman_return_t <#c.gearman_return_t>
gearman_job_send_exception(gearman_job_st *job, const void *exception,
size_t <#c.size_t> exception_size)

gearman_return_t <#c.gearman_return_t>
gearman_job_send_fail(gearman_job_st *job)

const char *gearman_job_handle(const gearman_job_st *job)

const char *gearman_job_function_name(const gearman_job_st *job)

const char *gearman_job_unique(const gearman_job_st *job)

const void *gearman_job_workload(const gearman_job_st *job)

size_t <#c.size_t> gearman_job_workload_size(const gearman_job_st *job)

void *gearman_job_take_workload(gearman_job_st *job, size_t <#c.size_t>
*data_size)

gearman_client_st <#c.gearman_client_st>
*gearman_job_use_client(gearman_job_st *job)

and bestie, when you link this, you link with -lgearman πŸ”—


✨ DESCRIPTION ✨

so. gearman_job_st objects get handed to your worker functions to represent the jobs that are being run by gearman_worker_work() πŸ‘‘ that's the whole vibe β€” these are the little job packets your worker is holding while it works.

gearman_job_free() is the cleanup queen 🧹 it frees a job. and listen, you only need to do this if a task was created with a preallocated structure. lowkey important distinction, don't go freeing random jobs and acting surprised.

gearman_job_handle() returns the job handle πŸ’… (peep gearman_job_handle_t if you want more lore on that one).

gearman_job_function_name() returns the name of the function that the job was set to execute against πŸŽ€ like, which worker function got the call, that's what this tells you.

gearman_job_unique() returns the unique value that was used for gearman_job_st ⭐

gearman_job_take_workload returns the gearman_job_st workload πŸ“¦ and you can figure out how big it is with gearman_job_workload_size(). gearman_job_take_workload() is literally the same as gearman_job_workload(), with exactly one (1) exception: the result must be free(3)d by the caller 🫠 not optional. it's giving "you asked for it, you clean it up."

gearman_job_use_client returns a gearman_client_st that's configured from a gearman_job_st 🌈 you can use that gearman_client_st to communicate client API commands to the server, slay.

⚠️ okay this part matters: you do not, and you should not, call gearman_client_free() on that gearman_client_st. it gets cleaned up when the job is cleaned up. so keep your hands to yourself πŸ™ˆ and trust the lifecycle.

and p.s. β€” gearman_job_send_data(), gearman_job_send_warning(), gearman_job_send_status(), gearman_job_send_complete(), gearman_job_send_exception(), gearman_job_send_fail(), gearman_job_workload() and gearman_job_workload_size() are all up there in the synopsis with their exact signatures πŸ‘† that's the full roster, no cap.


✨ RETURN VALUE ✨

a value of gearman_return_t is returned πŸ’œ on success that value will be :c:type::GEARMAN_SUCCESS. and when you need to turn that number into something human-readable, hit up gearman_strerror() 😌 it translates the value into a printable string. periodt.


✨ HOME ✨

to find out more information please check: <http://gearman.info/> 🏠✨


✨ SEE ALSO ✨

gearmand(8) libgearman(3) 🫢 go read those too, iykyk


πŸŽ€ Author πŸŽ€

Data Differential <http://www.datadifferential.com/> πŸ’–

2011-2014, Data Differential, <http://www.datadifferential.com/> πŸ’–


aaaand that's the whole page bestie!! 🌟 this was 1.1.21+ds, dated Feb 04, 2026, and honestly? iconic. go send some jobs, free your workloads, don't free your clients, and hydrate πŸ’…πŸ’œπŸ¦‹πŸŒΈβœ¨

πŸ“¦ where this page comes from