GEARMAN_JOB_WORKLOAD(3)
π NAME π
gearman_job_workload β Gearmand Documentation, http://gearman.info/
okay so bestie, this is a page out of the Gearmand manual, section 3. It's the one about job workloads and all the little job-handling functions that come with libgearman. Let's get into it π
β¨ 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)
Link with -lgearman π«Ά
π DESCRIPTION π
gearman_job_st are the little job objects that get handed to your worker functions β they're how the library represents jobs that are being run by gearman_worker_work(). So like, every time your worker picks something up, this is the thing it's holding. main character energy, honestly.
gearman_job_free() is what you call to free a job. Important caveat bestie: you only need to do this if a task was created with a preallocated structure. Don't go freeing stuff that ain't yours π
gearman_job_handle() returns the job handle β see gearman_job_handle_t if you want the whole lore on that one.
gearman_job_function_name() returns the name of the function that the job was set to execute against. Basically: which worker function is this job for?
gearman_job_unique() returns the unique value that was used for gearman_job_st.
gearman_job_take_workload returns the gearman_job_st workload. You can figure out how big it is with gearman_job_workload_size(). And here's the tea: gearman_job_take_workload() is literally the same as gearman_job_workload(), except that the result must be free(3)'d by the caller. So yeah β that's on you, not on the library. Own it π
gearman_job_use_client returns a gearman_client_st that's configured from the gearman_job_st. You can use that gearman_client_st to communicate client API commands to the server. But listen β 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. Let the library handle its own business, bestie π
πΈ RETURN VALUE πΈ
A value of gearman_return_t is returned. On success that value will be :c:type::GEARMAN_SUCCESS. And if you ever need to turn that value into something a human can actually read, use gearman_strerror() to translate it into a printable string. Slay β¨
ok but for real β always check your return values. no cap.
π¦ HOME π¦
To find out more information please check: <http://gearman.info/>
π SEE ALSO π
π Author π
Data Differential http://www.datadifferential.com/
β Copyright β
2011-2014, Data Differential, http://www.datadifferential.com/
and that's the whole page bestie π this one's from the Gearmand 1.1.21+ds manual, dated Feb 04, 2026 π go forth and handle your workloads responsibly, mwah π«Άβ¨
π¦ 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