gearman_worker_add_server.rst 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. ==============
  2. Adding Servers
  3. ==============
  4. --------
  5. SYNOPSIS
  6. --------
  7. #include <libgearman/gearman.h>
  8. .. c:function:: gearman_return_t gearman_worker_add_server(gearman_worker_st *worker, const char *host, in_port_t port)
  9. .. c:function:: gearman_return_t gearman_worker_add_servers(gearman_worker_st *worker, const char *servers)
  10. .. c:function:: void gearman_worker_remove_servers(gearman_worker_st *worker)
  11. Link with -lgearman
  12. -----------
  13. DESCRIPTION
  14. -----------
  15. :c:func:`gearman_worker_add_server` will add an additional :program:`gearmand` server to the list of servers that the worker will take work from.
  16. :c:func:`gearman_worker_remove_servers` will remove all servers from the :c:type:`gearman_worker_st`.
  17. :c:func:`gearman_worker_add_servers` takes a list of :program:`gearmand` servers that will be parsed to provide servers for the worker. The format for this is SERVER[:PORT][,SERVER[:PORT]]...
  18. Examples of this are::
  19. 10.0.0.1,10.0.0.2,10.0.0.3
  20. localhost234,jobserver2.domain.com:7003,10.0.0.3
  21. ------------
  22. RETURN VALUE
  23. ------------
  24. :c:func:`gearman_worker_add_server` and :c:func:`gearman_worker_remove_servers` return :c:type:`gearman_return_t`.
  25. ----
  26. HOME
  27. ----
  28. To find out more information please check:
  29. `https://gearman.org/gearmand/ <https://gearman.org/gearmand/>`_
  30. .. seealso:: :program:`gearmand` :doc:`../libgearman` :c:type:`gearman_worker_st`