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/

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