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 (peep gearman_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 for gearman_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 the gearman_job_st workload. you can figure out how big it is with gearman_job_workload_size(). it's the same as gearman_job_workload(), with one big exception: the result must be free(3)'d by the caller. πŸ‘€ you want it, you own it.
  • gearman_job_use_client() β€” returns a gearman_client_st <#c.gearman_client_st> configured from a gearman_job_st. you can use that gearman_client_st to communicate client API commands to the server. but listen: you do not, and honestly should not, call gearman_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/

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