GEARMAN_CLIENT_DO_LOW(3)
π GEARMAN_CLIENT_DO_LOW(3) π
okay bestie, gather round, because we're reading the Gearmand docs together and honestly? this one's a whole vibe. it lives in the Gearmand manual, section 3, and it's all about sending one job and waiting ever so patiently for the answer like the main character you are. β¨
πΈ NAME πΈ
gearman_client_do_low β Gearmand Documentation, <http://gearman.info/>
π SYNOPSIS π
first up, you gotta invite the library in:
#include <libgearman/gearman.h>
then, the trio of icons π :
void *gearman_client_do(gearman_client_st <#c.gearman_client_st>
*client, const char *function_name, const char *unique, const void
*workload, size_t <#c.size_t> workload_size, size_t <#c.size_t>
*result_size, gearman_return_t <#c.gearman_return_t> *ret_ptr)
Changed in version 0.21: GEARMAN_PAUSE <#c.GEARMAN_PAUSE> will no longer be returned. A do operation will now run till completion or error. no take-backs, no pauses, it's giving commitment. π€
void *gearman_client_do_high(gearman_client_st <#c.gearman_client_st>
*client, const char *function_name, const char *unique, const void
*workload, size_t <#c.size_t> workload_size, size_t <#c.size_t>
*result_size, gearman_return_t <#c.gearman_return_t> *ret_ptr)
void *gearman_client_do_low(gearman_client_st <#c.gearman_client_st>
*client, const char *function_name, const char *unique, const void
*workload, size_t <#c.size_t> workload_size, size_t <#c.size_t>
*result_size, gearman_return_t <#c.gearman_return_t> *ret_ptr)
π¦ DESCRIPTION π¦
okay so gearman_client_do() executes a single request to the gearmand server and waits for a reply. one request, one reply, that's it, that's the whole plot. π«Ά
gearman_client_do_high() and gearman_client_do_low() are identical to gearman_client_do() β like, twins fr fr β only they set the priority to either high or low. that's the entire difference. lowkey iconic.
and all of the functions will block until either a response or an error is returned. no multitasking, no sneaking off, they're locked in. π₯
π RETURN VALUE π
gearman_client_do() returns a pointer to a value that the caller must release. (yes you, bestie, you gotta free it, don't leave it hanging π)
if ret_ptr is provided, any errors that have occurred will be stored in it. and here's the plot twist: since a NULL/zero value is a valid value, you will always need to check ret_ptr if you are concerned with errors. like, a zero result is not an error, so don't come for it. π
β οΈ fr fr checkret_ptrβNULL/zero is legit output, not a red flag by itself.
π EXAMPLE π
look at this gorgeous little program, she's perfect, no notes:
/*
# 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, the whole friend group:
π Author π
Data Differential <http://www.datadifferential.com/>
π Copyright π
2011-2014, Data Differential, <http://www.datadifferential.com/>
and that's the page, bestie β this was libgearman version 1.1.21+ds, dated Feb 04, 2026, and honestly it ate. go forth and gearman_client_do_low() responsibly, mwah ππ§β¨
π¦ 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