GEARMAN_JOB_FREE(3)

πŸ’– GEARMAN_JOB_FREE πŸ’–

okay so bestie, we're deep in the Gearmand docs rn β€” this is page gearman_job_free(3) from section 3 of the Gearmand manual, and the whole doc situation lives over at http://gearman.info/ (that's literally the NAME, no cap). 🫢


✨ NAME ✨

gearman_job_free β€” Gearmand Documentation, http://gearman.info/ 🌸


✨ SYNOPSIS ✨

lowkey the receipts first, here's the whole vibe, verbatim:

#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 build, you link it like this, periodt:

Link with -lgearman

πŸ’… DESCRIPTION πŸ’…

so gearman_job_st are literally handed straight to your worker functions β€” they're the whole little representation of the jobs currently being run by gearman_worker_work(). main character energy, obviously. ✨

  • gearman_job_free() β€” frees a job. that's it, that's the function. IMPORTANT: you only need to do this if the task was created with a preallocated structure. otherwise, hands off, bestie. πŸ™ˆ
  • gearman_job_handle() β€” returns the job handle. (peep gearman_job_handle_t if you want the full lore on that.)
  • gearman_job_function_name() β€” returns the name of the function that this job was set to execute against. like, what was it even hired to do. πŸŽ€
  • 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(). it's basically gearman_job_workload() with a plot twist: the result must be free(3)d by the caller. so like, it's yours now, you clean it up. 🧹
  • gearman_job_use_client β€” returns a gearman_client_st configured from gearman_job_st. you can use that gearman_client_st to talk client API commands to the server. and listen β€” you do not, and should not, call gearman_client_free() on that gearman_client_st. it gets cleaned up when the job gets cleaned up. it's giving ✨self-managing✨. do not interfere. πŸ’€

🌈 RETURN VALUE 🌈

a value of gearman_return_t is returned. on success, that value will be :c:type::GEARMAN_SUCCESS. slay. if you need to translate that value into a printable string, use gearman_strerror(). πŸ‘‘


🏠 HOME 🏠

to find out more information please check: http://gearman.info/ β€” that's the house, that's where the lore lives, iykyk. πŸ¦‹


πŸ‘€ 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 was 1.1.21+ds, dated Feb 04, 2026, and fr fr you ate for reading all the way down here. go free your jobs (only the preallocated ones!!) and stay iconic. πŸ’–πŸŽ€πŸ«Άβœ¨

πŸ“¦ where this page comes from