GEARMAN_CLIENT_DO_HIGH(3)
π GEARMAN_CLIENT_DO_HIGH(3) π
okay so bestie, we're in section 3 of the Gearmand manual, and today's main character is gearman_client_do_high β plus its two ride-or-die siblings. Buckle up, it's giving "let's actually understand async job priorities" energy. π¦
β¨ NAME β¨
gearman_client_do_high β Gearmand Documentation, http://gearman.info/
β¨ SYNOPSIS β¨
First up, the header you gotta pull in, no cap:
#include <libgearman/gearman.h>
Then the trio. Here's the plain one, gearman_client_do:
void *gearman_client_do(gearman_client_st *client, const char *function_name, const char *unique, const void *workload, size_t workload_size, size_t *result_size, gearman_return_t *ret_ptr)
And here's the glow-up, gearman_client_do_high:
void *gearman_client_do_high(gearman_client_st *client, const char *function_name, const char *unique, const void *workload, size_t workload_size, size_t *result_size, gearman_return_t *ret_ptr)
And the chill one, gearman_client_do_low:
void *gearman_client_do_low(gearman_client_st *client, const char *function_name, const char *unique, const void *workload, size_t workload_size, size_t *result_size, gearman_return_t *ret_ptr)
π¨ Changed in version 0.21: GEARMAN_PAUSE will no longer be returned. A do operation will now run till completion or error. So likeβ¦ no more pausing mid-vibe. It's all or nothing now, periodt.
πΈ DESCRIPTION πΈ
Okay so gearman_client_do() does one single request to the gearmand server, then justβ¦ sits there and waits for the reply. Very demure, very "I sent the text and now I'm refreshing the chat" energy. π
gearman_client_do_high() and gearman_client_do_low() are literally identical to gearman_client_do() β no extra drama, no bonus options β the only difference is they set the priority to either high or low. That's it. That's the whole flex.
And all of these functions will block until either a response comes back or an error shows up. So your thread is not going anywhere until gearmand answers. π
β RETURN VALUE β
gearman_client_do() returns a pointer to a value that the caller must release. Yes bestie, that means you free it. It's your problem now. π«Ά
If ret_ptr is provided, any errors that have occurred will be stored in it.
π Important, fr fr: since aNULL/zero value is a valid value, you will always need to checkret_ptrif you are concerned with errors. Like β a NULL result does not automatically mean something went wrong. Check the return code, always. ikyky.
π EXAMPLE π
Here's a whole lil program doing the thing:
/*
# Gearman server and library
# Copyright (C) 2012 Data Differential, http://datadifferential.com/
# All rights reserved.
#
# Use and distribution licensed under the BSD license. See
# the COPYING file in this directory for full text.
*/
#include <string.h>
#include <stdlib.h>
#include <libgearman/gearman.h>
int main(void)
{
gearman_client_st *client= gearman_client_create(NULL);
gearman_return_t ret= gearman_client_add_server(client, "localhost", 0);
if (gearman_failed(ret))
{
return EXIT_FAILURE;
}
size_t result_size;
gearman_return_t rc;
void *value= gearman_client_do(client, "reverse_function", "unique_value",
"my string to reverse", strlen("my string to reverse"),
&result_size, &rc);
if (gearman_success(rc))
{
// Make use of value
}
free(value);
gearman_client_free(client);
return 0;
}
π HOME π
To find out more information please check: http://gearman.info/
See also:
π Author
Data Differential http://www.datadifferential.com/
π Copyright
2011-2014, Data Differential, http://www.datadifferential.com/
okay that's the whole page bestie, you ate it, go forth and prioritize your workloads πβ¨
This one came from 1.1.21+ds, dated Feb 04, 2026 β and yes, that's the same GEARMAN_CLIENT_DO_HIGH(3) energy you started with. slay π
π¦ 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