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 π (peepgearman_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 forgearman_job_st. the lore, the backstory π¦gearman_job_take_workloadβ returns thegearman_job_stworkload. you can figure out how big it is withgearman_job_workload_size(). andgearman_job_take_workload()is literally the same asgearman_job_workload()except β and this is the important bit β the result must befree(3)by the caller. you own it now, bestie, it's yours πΈgearman_job_use_clientβ returns agearman_client_st<#c.gearman_client_st> configured fromgearman_job_st. you can use thatgearman_client_stto communicate client API commands to the server π«
β οΈ okay listen: you do not, and should not, callgearman_client_free()<#c.gearman_client_free> on thegearman_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/>
π Copyright π
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
- ubuntu resolute: libgearman-dev 1.1.21+ds-1ubuntu3 Β· BSD-3-Clause
- ubuntu stonking: libgearman-dev 1.1.21+ds-1ubuntu3 Β· BSD-3-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms