GEARMAN_JOB_ST(3)

πŸ‘‘ GEARMAN_JOB_ST ✨

okay bestie, gather round, because this is the GEARMAN_JOB_ST(3) page from the Gearmand manual β€” yes, that's a section 3 library page, we love a lib moment πŸ’…


🌸 NAME 🌸

gearman_job_st β€” 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 when you link this whole thing, you're linking with -lgearman. periodt. πŸ”₯


πŸ’– DESCRIPTION πŸ’–

so like. gearman_job_st is what gets handed off to your worker functions, and it represents the jobs that are being run by gearman_worker_work() <#c.gearman_worker_work>. it's giving "the actual task in your hands" energy, fr fr. 🫢

gearman_job_free() frees a job. glow-up note: you only need to do this if a task was created with a preallocated structure. otherwise, hands off, bestie.

gearman_job_handle() returns the job handle β€” peep gearman_job_handle_t <#c.gearman_job_handle_t> for more info if you wanna know the whole lore.

gearman_job_function_name() returns the name of the function that the job was set to execute against. it's the job's whole identity ngl. ✨

gearman_job_unique() returns the unique value that was used for gearman_job_st. yes it's literally called unique, the naming team ate. πŸ’…

gearman_job_take_workload returns the gearman_job_st workload, and the size of it can be figured out with gearman_job_workload_size(). here's the part you gotta pay attention to: gearman_job_take_workload() is the same as gearman_job_workload() except that the result must be free(3) by the caller. you own that memory now, bestie. don't forget it or it's a leak, and leaks are not the vibe. 😭

gearman_job_use_client returns a gearman_client_st <#c.gearman_client_st> that's configured from gearman_job_st. you can use that gearman_client_st to communicate client API commands to the server. πŸ¦‹

🚨 IMPORTANT, no cap: you do not β€” and should not β€” call gearman_client_free() <#c.gearman_client_free> on that gearman_client_st. it gets cleaned up when the job is cleaned up. it's not yours to free, it's a borrow, okay? mind your business and let the job handle its own breakup. πŸ’€

⭐ RETURN VALUE ⭐

a value of gearman_return_t <#c.gearman_return_t> is returned. on success that value will be :c:type::GEARMAN_SUCCESS. and if you're sitting there like "what does this number MEAN", use gearman_strerror() <#c.gearman_strerror> to translate that value into a printable string. slay. πŸ™ˆ


🌈 HOME 🌈

if you wanna find out more, go check out: http://gearman.info/ πŸŽ€


πŸ‘‘ SEE ALSO πŸ‘‘


πŸ¦‹ Author πŸ¦‹

Data Differential http://www.datadifferential.com/


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


that's the whole page bestie, you ate that πŸ“

okay so final cute sign-off moment: this gem is version 1.1.21+ds, dated Feb 04, 2026, and it lives as GEARMAN_JOB_ST(3) in the Gearmand manual. go forth and free your workloads responsibly πŸ’–βœ¨

πŸ“¦ where this page comes from