GEARMAN_JOB_WORKLOAD_SIZE(3)
πΈ GEARMAN_JOB_WORKLOAD_SIZE πΈ
okay bestie, buckle up, because this is the entire libgearman job-object era in one page. it's from the Gearmand docs over at <http://gearman.info/> and it's lowkey iconic. π
π NAME π
gearman_job_workload_size β Gearmand Documentation, <http://gearman.info/>
so like, yes, the page is named after the workload-size function, but it's actually the whole gearman_job_st situation. it's giving "one girl, forty functions". β¨
π¦ 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 then, the moment you've all been waiting for:
Link with -lgearman
periodt. link it or it doesn't exist. π₯
β¨ DESCRIPTION β¨
gearman_job_st is the lil struct that gets handed to your worker functions to represent the jobs that are actively being run by gearman_worker_work() <#c.gearman_worker_work>. it's basically the job's main character card. π
π freeing the girl
gearman_job_free()β frees a job. and listen, bestie: you only need to do this if a task was created with a preallocated structure. that's the whole rule. don't go freeing things that weren't preallocated, okay? π
π the lil getters
gearman_job_handle()β returns the job handle. (peepgearman_job_handle_t<#c.gearman_job_handle_t> if you want the full tea 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 forgearman_job_st.
π the workload section (the actual assignment)
gearman_job_take_workloadβ returns thegearman_job_stworkload. the size of it can be determined withgearman_job_workload_size(). and here's the plot twist:gearman_job_take_workload()is exactly the same asgearman_job_workload()except that the result must befree(3)'d by the caller. so you did take it. it's yours now. you own it. clean it up. π
π the client glow-up
gearman_job_use_clientβ returns agearman_client_st<#c.gearman_client_st> configured from agearman_job_st. you can use thatgearman_client_stto fire client API commands at the server. and now the important part, ok?
You do not, and should not, callgearman_client_free()<#c.gearman_client_free> on thatgearman_client_st. it gets cleaned up when the job is cleaned up. so hands off. π ββοΈ
π RETURN VALUE π
a value of gearman_return_t <#c.gearman_return_t> comes back at you. on success, that value will be :c:type::GEARMAN_SUCCESS. π«Ά
and if you're sitting there like "what does this number mean" β use gearman_strerror() <#c.gearman_strerror> to translate it into a printable string. slay, now you can read it.
π HOME π
wanna know more? go look: <http://gearman.info/>
it's the mothership. go touch grass there. π±
β 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!! π you just read the GEARMAN_JOB_WORKLOAD_SIZE(3) manual from Gearmand, version 1.1.21+ds, dated Feb 04, 2026. take that knowledge and go make your workers do incredible things. so proud of you. no cap. πβ¨π¦
π¦ 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