GEARMAN_JOB_SEND_COMPLETE(3)

πŸ’– GEARMAN_JOB_SEND_COMPLETE πŸ’–

okay so bestie, welcome to the gearmand manual, section 3 πŸŽ€ this one's all about the worker side of things β€” the lil' functions you call when you're the one doing the job instead of the one asking for it. full docs live at http://gearman.info/ if you want the ✨lore✨.


🌸 NAME 🌸

gearman_job_send_complete β€” Gearmand Documentation, http://gearman.info/

✨ SYNOPSIS ✨

the vibes, verbatim πŸ’…:

#include <libgearman/gearman.h>

type gearman_job_st

void gearman_job_free(gearman_job_st *job)

gearman_return_t
gearman_job_send_data(gearman_job_st *job, const void *data, size_t data_size)

gearman_return_t
gearman_job_send_warning(gearman_job_st *job, const void *warning,
size_t warning_size)

gearman_return_t
gearman_job_send_status(gearman_job_st *job, uint32_t numerator,
uint32_t denominator)

gearman_return_t
gearman_job_send_complete(gearman_job_st *job, const void *result,
size_t result_size)

gearman_return_t
gearman_job_send_exception(gearman_job_st *job, const void *exception,
size_t exception_size)

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 gearman_job_workload_size(const gearman_job_st *job)

void *gearman_job_take_workload(gearman_job_st *job, size_t *data_size)

gearman_client_st *gearman_job_use_client(gearman_job_st *job)

and when you link, you link with -lgearman. that's the whole vibe check, no notes 🫢


πŸ’œ DESCRIPTION πŸ’œ

so like, gearman_job_st is the lil' struct that gets passed to your worker functions to represent the jobs that are actually being run by gearman_worker_work(). it's giving main character energy, fr fr β€” every job gets one. πŸ‘‘

  • gearman_job_free() is the one that lets a job go πŸ¦‹. lowkey you only have to do this if a task was created with a preallocated structure β€” otherwise don't stress.
  • gearman_job_handle() hands you back the job handle (peep gearman_job_handle_t if you want the whole story on that).
  • 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 for the gearman_job_st. it's literally unique, that's the point bestie ✨
  • gearman_job_take_workload returns the gearman_job_st workload. you can figure out how big it is with gearman_job_workload_size(). and here's the tea: gearman_job_take_workload() is the same as gearman_job_workload() EXCEPT the result must be free(3)'d by the caller. so like, you own it now, babes β€” clean up after yourself πŸ’…
  • gearman_job_use_client returns a gearman_client_st configured from the gearman_job_st. that gearman_client_st can be used to communicate client API commands to the server. 🌈
⚠️ okay important: you do not, and should not, call gearman_client_free() on that gearman_client_st. it gets cleaned up when the job is cleaned up. it's not yours, don't touch it, it has a home already 😭🫢

⭐ RETURN VALUE ⭐

you get back a gearman_return_t. on success that value will be GEARMAN_SUCCESS πŸŽ‰ and when it's not that, use gearman_strerror() to translate the value into a printable string so you can actually read what went wrong. iconic little helper, honestly.

🏠 HOME 🏠

want more? go check: http://gearman.info/ 🌸

πŸ‘€ SEE ALSO πŸ‘€

gearmand(8) libgearman(3)


πŸŽ€ Author πŸŽ€

Data Differential http://www.datadifferential.com/

2011-2014, Data Differential, http://www.datadifferential.com/


and that's a wrap bestie πŸ’– this was Gearmand 1.1.21+ds, dated Feb 04, 2026 β€” go forth and send those completions, you absolute server-side legend πŸ‘‘βœ¨πŸ’…

πŸ“¦ where this page comes from