GEARMAN_JOB_FREE_ALL(3)

πŸŽ€ GEARMAN_JOB_FREE_ALL(3) πŸŽ€

okay bestie, welcome to a page from the Gearmand manual, section 3 πŸ’– sit down, grab a lil snack, this one's a whole tour of the job-handling API and it's lowkey iconic.


✨ NAME ✨

gearman_job_free_all β€” 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, you gotta link with -lgearman. no -lgearman, no vibes. ✨


πŸ’… DESCRIPTION πŸ’…

gearman_job_st is the moment. These get passed to worker functions to represent jobs that are being run by gearman_worker_work() <#c.gearman_worker_work>. that's literally their whole job (pun fully intended 🫢).

gearman_job_free() is how you free a job. and listen β€” you only need to do this if a task was created with a preallocated structure. so don't go freeing randoms, that's not the vibe.

gearman_job_handle() returns the job handle (peep gearman_job_handle_t <#c.gearman_job_handle_t> if you want the whole story on that).

gearman_job_function_name() returns the name of the function that the job was set to execute against.

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

gearman_job_take_workload returns the gearman_job_st workload. the size of it can be determined with gearman_job_workload_size(). and here's the tea β˜•: gearman_job_take_workload() is the same as gearman_job_workload() with the exception that the result must be free(3) by the caller. so like, caller's gotta clean up their own mess, bestie. no cap.

gearman_job_use_client returns a gearman_client_st <#c.gearman_client_st> configured from gearman_job_st. that gearman_client_st can be used to communicate client API commands to the server. and NOW the important part:

You do not, and should not, call gearman_client_free() <#c.gearman_client_free> on the gearman_client_st. It is cleaned up when the job is cleaned up. do not do it. i'm serious. πŸ™ˆ

also, just so you know what's on the menu β€” the synopsis above also lists gearman_job_send_data, gearman_job_send_warning, gearman_job_send_status, gearman_job_send_complete, gearman_job_send_exception, gearman_job_send_fail and gearman_job_workload. they're all part of this lil crew 🌸


πŸ‘‘ RETURN VALUE πŸ‘‘

A value of gearman_return_t <#c.gearman_return_t> is returned. On success that value will be :c:type::GEARMAN_SUCCESS. if you ever need to turn that into actual human words, use gearman_strerror() <#c.gearman_strerror> to translate it to a printable string. slay. πŸ’…βœ¨


🌈 HOME 🌈

Want more? Go 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, you ATE that reading thing πŸ’– this edition was version 1.1.21+ds, dated Feb 04, 2026 β€” thanks for coming to my ted talk, go free some jobs responsibly πŸ«ΆπŸ’…βœ¨

πŸ“¦ where this page comes from