GEARMAN_CLIENT_JOB_STATUS(3)

✨ NAME ✨

gearman_client_job_status β€” it's giving Gearmand Documentation energy, bestie. Check it out at <http://gearman.info/> πŸ’–


πŸ¦‹ SYNOPSIS πŸ¦‹

#include <libgearman/gearman.h>

gearman_return_t gearman_client_job_status(gearman_client_st *client,
                                           gearman_job_handle_t job_handle,
                                           bool *is_known,
                                           bool *is_running,
                                           uint32_t *numerator,
                                           uint32_t *denominator)

And you gotta link it like this, no cap:

-lgearman

🌸 DESCRIPTION 🌸

Okay so gearman_client_job_status() is literally the function you call when you wanna know what's up with a job, and you find it by its gearman_job_handle_t. Iconic. πŸ‘‘

Now here's the tea: is_known, is_running, numerator, and denominator are all optional arguments. Every single one. You can pass them, you can skip them, the function does not care fr fr.

About those numerator/denominator values though β€” unless a Gearman worker has actually sent them over via gearman_job_send_status(), they're gonna be zero. Not zero as a vibe, zero as a number. πŸ’€

And if you omit is_known and is_running? Then the function just hands you the state data back through gearman_return_t instead. Slay.


πŸ”₯ RETURN VALUE πŸ”₯

You get a gearman_return_t back, obviously. When the status gets updated successfully, GEARMAN_SUCCESS is what you're seeing. Periodt.

But wait β€” if you skipped is_known and is_running, then gearman_client_job_status() switches it up and returns:

  • GEARMAN_JOB_EXISTS β€” if the gearman_job_handle_t is known on the server
  • GEARMAN_IN_PROGRESS β€” if it's running
Knowing whether the job is running or not has higher precedence β€” that's the main character of the two, lowkey.

Also gearman_continue() is your bestie for loops where you wanna bounce out of the loop once the job is done. 🫢

πŸ’… Warning πŸ’…

For loops you should always check gearman_return_t with gearman_continue(), even if you specified the argument is_known or is_running. A non-blocking IO call can return something other than GEARMAN_SUCCESS, and in some cases you will want to treat those values not as errors. So don't just assume, okay? πŸ™ˆ

πŸŽ€ HOME πŸŽ€

Wanna find out more? Go check out: <http://gearman.info/>

See also: gearmand(8) libgearman(3) gearman_client_st(3) gearman_job_handle_t(3) gearman_continue(3


πŸ‘‘ Author πŸ‘‘

Data Differential β€” <http://www.datadifferential.com/>

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


And that's the whole page bestie, we ate and left no crumbs 🌈✨ β€” this was version 1.1.21+ds from Feb 04, 2026, brought to you by Gearmand (GEARMAN_CLIENT_JOB_STATUS(3)). Go forth and check your job statuses, you're doing amazing πŸ¦‹πŸ’–

πŸ“¦ where this page comes from