GEARMAN_JOB_USE_CLIENT(3)
π GEARMAN_JOB_USE_CLIENT π
okay bestie, welcome to the GEARMAN_JOB_USE_CLIENT(3) page from the Gearmand manual πβ¨ pull up a chair, grab a strawberry π, we're gonna talk about jobs.
πΈ 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)
Link with -lgearman π
β¨ DESCRIPTION β¨
okay so. gearman_job_st objects 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 thing π
gearman_job_free()β frees a job. π§Ή and listen, you only ever gotta do this if a task was created with a preallocated structure. otherwise don't bother, no cap.gearman_job_handle()β returns the job handle (peepgearman_job_handle_t<#c.gearman_job_handle_t> for the whole lore). π·οΈ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 forgearman_job_st. π¦gearman_job_take_workloadβ returns thegearman_job_stworkload. how big is it? you find that out withgearman_job_workload_size(). πgearman_job_take_workload()is the same asgearman_job_workload()except for one tiny little thing: the result must befree(3)d by the caller. yes, you. by you. πgearman_job_use_clientβ returns agearman_client_st<#c.gearman_client_st> configured fromgearman_job_st. thatgearman_client_stcan be used to communicate client API commands to the server. π¬β¨
okay this next bit is IMPORTANT bestie: you do not, and should not, callgearman_client_free()<#c.gearman_client_free> on thatgearman_client_st. it gets cleaned up when job is cleaned up. hands off, let it live its life π«Ά
π RETURN VALUE π
a value of gearman_return_t <#c.gearman_return_t> is returned. on success that value will be :c:type::GEARMAN_SUCCESS. use gearman_strerror() <#c.gearman_strerror> to translate this value into a printable string, so you actually know what it's saying to you πβ
π HOME π
wanna find out more info? go check out: <http://gearman.info/> π
π SEE ALSO π
π Author π
Data Differential <http://www.datadifferential.com/>
π Copyright π
2011-2014, Data Differential, <http://www.datadifferential.com/>
and that's the whole page, periodt π
this was version 1.1.21+ds, dated Feb 04, 2026 β mwah, slay, go write some workers bestie πβ¨π¦
π¦ 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