GEARMAN_JOB_UNIQUE(3)
β¨ GEARMAN_JOB_UNIQUE β¨
hiii bestie π welcome to GEARMAN_JOB_UNIQUE(3), straight out of the Gearmand manual. yes the manual name is literally just Gearmand, iconic naming, no notes. anyway sit down, grab a boba, we're learning libgearman's job API together and honestly? it's giving essential.
πΈ NAME πΈ
gearman_job_unique β 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 when you build, link with -lgearman or it's not gonna work, fr fr.
π¦ DESCRIPTION π¦
okay so gearman_job_st β these get passed to your worker functions to represent the jobs that are actually being run by gearman_worker_work() <#c.gearman_worker_work>. like, that's the whole vibe. the job struct is the job.
gearman_job_free()β frees a job. and before you go freeing everything in sight: bestie, you only need to do this if a task was created with a preallocated structure. that's the only time. read that twice πgearman_job_handle()β hands you back the job handle (peepgearman_job_handle_t<#c.gearman_job_handle_t>if you want the deets on that one).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. yes, that's the star of the show today, the whole reason this page is named what it's named.gearman_job_take_workload()β returns thegearman_job_stworkload. you can figure out how big it is withgearman_job_workload_size(). it's the same asgearman_job_workload(), with one big exception: the result must befree(3)'d by the caller. π you want it, you own it.gearman_job_use_client()β returns agearman_client_st<#c.gearman_client_st>configured from agearman_job_st. you can use thatgearman_client_stto communicate client API commands to the server. but listen: you do not, and honestly should not, callgearman_client_free()<#c.gearman_client_free>on it. it gets cleaned up when the job gets cleaned up. let the job handle its own business, she's independent π
bestie PSA:gearman_job_workload()is the chill one,gearman_job_take_workload()is the "okay but now it's YOUR problem" one. choose accordingly.
π RETURN VALUE π
a value of gearman_return_t <#c.gearman_return_t> is returned, periodt. on success that value will be :c:type::GEARMAN_SUCCESS. and if you get something else and you're staring at it like ποΈπποΈ, use gearman_strerror() <#c.gearman_strerror> to translate that value into a printable string. bless.
π HOME π
to find out more information please check: http://gearman.info/ β go, read, slay.
β SEE ALSO β
π Author π
Data Differential http://www.datadifferential.com/
π Copyright π
2011-2014, Data Differential, http://www.datadifferential.com/
and that's the whole page, bestie π«Ά this was version 1.1.21+ds, dated Feb 04, 2026 β go forth, handle your jobs, free only what you're supposed to free, and don't you dare call gearman_client_free() on that client. mwah πβ¨
π¦ 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