GEARMAN_WORKER_ADD_SERVER(3)

πŸŽ€ NAME πŸŽ€

gearman_worker_add_server β€” the Gearmand documentation situation, live and direct from <http://gearman.info/> πŸ’– (that's the manual name too, bestie, in case you were wondering β€” we're in GEARMAN_WORKER_ADD_SERVER(3) territory ✨)


🌸 SYNOPSIS 🌸

okay so first you gotta pull in the goods:

#include <libgearman/gearman.h>

and then here's the whole squad of functions you're working with, fr fr:

gearman_return_t
gearman_worker_add_server(gearman_worker_st *worker, const char *host, in_port_t port)

gearman_return_t
gearman_worker_add_servers(gearman_worker_st *worker, const char *servers)

void gearman_worker_remove_servers(gearman_worker_st *worker)

and don't forget to link it up, no cap:

Link with -lgearman

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so let's break it down, bestie, because these three are lowkey doing different things and you do NOT wanna mix them up πŸ’…

gearman_worker_add_server() will add an additional gearmand server to the list of servers that the worker will take work from. another one, added to the roster, iconic behavior honestly πŸ‘‘

gearman_worker_remove_servers() will remove all servers from the gearman_worker_st. all of them. every single one. it's giving clear-the-group-chat 😭

gearman_worker_add_servers() takes a list of gearmand servers that will be parsed to provide servers for the worker. the format for this is:

SERVER[:PORT][,SERVER[:PORT]]...

Examples of this are:

10.0.0.1,10.0.0.2,10.0.0.3
localhost234,jobserver2.domain.com:7003,10.0.0.3
yes bestie, localhost234 is literally in the docs exactly like that, we do not question the classics, we simply observe and move on πŸ™ˆ

⭐ RETURN VALUE ⭐

gearman_worker_add_server() and gearman_worker_remove_servers() return gearman_return_t. that's the vibe check result right there, so go read it, don't just ignore it 🌈


πŸ’œ HOME πŸ’œ

wanna find out more? (of course you do, you're a scholar πŸŽ“) go check out: <http://gearman.info/>

See also:

  • gearmand
  • Gearman Client/Worker Library
  • gearman_worker_st

✨ Author ✨

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

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


and that's the whole page, bestie πŸ’… this was 1.1.21+ds, dated Feb 04, 2026, coming at you straight from the good people at Data Differential β€” stay slay, go add some servers, and remember: gearman_worker_remove_servers() takes them ALL away, so maybe don't call it mid-job fr fr πŸ’–βœ¨

πŸ“¦ where this page comes from