Adding Servers


#include <libgearman/gearman.h>

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)

Link with -lgearman


gearman_worker_add_server() will add an additional gearmand server to the list of servers that the worker will take work from.

gearman_worker_remove_servers() will remove all servers from the gearman_worker_st.

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:,,


To find out more information please check:

Table Of Contents

Previous topic

Creating Gearman Worker Connections

Next topic

Worker Options