GEARMAN_JOB_HANDLE(3)

✨ gearman_job_handle β€” bestie's guide to the Gearman job handle πŸ’–

okay so this is a page from the Gearmand Documentation (head on over to http://gearman.info/ if you wanna snoop around), and it's literally all about the job handle situation in libgearman. strap in πŸŽ€


🌸 SYNOPSIS 🌸

like, pull in the header first, obviously:

#include <libgearman/gearman.h>

and here's the type + every single function, verbatim, no edits, no cap:

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, don't forget to link it: -lgearman πŸ’…


πŸ’œ DESCRIPTION πŸ’œ

so gearman_job_st is the lil' guy that gets handed off to worker functions to represent the jobs that are being run by gearman_worker_work() <#c.gearman_worker_work>. main character energy, honestly πŸ‘‘

  • gearman_job_free() β€” frees a job. and ngl, you only need to do this if a task was created with a preallocated structure. so don't be out here freeing things that don't need freeing πŸ™ˆ
  • gearman_job_handle() β€” returns the job handle πŸŽ€ (peep gearman_job_handle_t <#c.gearman_job_handle_t> if you want the full lore).
  • gearman_job_function_name() β€” returns the name of the function that the job was set to execute against. iykyk ✨
  • gearman_job_unique() β€” returns the unique value that was used for gearman_job_st. the lore, the backstory πŸ¦‹
  • gearman_job_take_workload β€” returns the gearman_job_st workload. you can figure out how big it is with gearman_job_workload_size(). and gearman_job_take_workload() is literally the same as gearman_job_workload() except β€” and this is the important bit β€” the result must be free(3) by the caller. you own it now, bestie, it's yours 🌸
  • gearman_job_use_client β€” returns a gearman_client_st <#c.gearman_client_st> configured from gearman_job_st. you can use that gearman_client_st to communicate client API commands to the server πŸ’«
⚠️ okay listen: you do not, and should not, call gearman_client_free() <#c.gearman_client_free> on the gearman_client_st. it gets cleaned up when the job is cleaned up. do not do it. periodt πŸ’€

🌈 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 like "what does this number mean" β€” use gearman_strerror() <#c.gearman_strerror> to translate it into a printable string ✨


🏠 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/>


okay that's the whole page, bestie, you're officially a job handle girlie now πŸ’…βœ¨ this was from version 1.1.21+ds, dated Feb 04, 2026 β€” slay, ate, no crumbs πŸ“πŸ’–

πŸ“¦ where this page comes from