gearman_client_do.rst 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. ========================
  2. Issuing a single request
  3. ========================
  4. --------
  5. SYNOPSIS
  6. --------
  7. #include <libgearman/gearman.h>
  8. .. c:function:: 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)
  9. .. versionchanged:: 0.21
  10. :c:type:`GEARMAN_PAUSE` will no longer be returned. A do operation will now run till completion or error.
  11. .. c:function:: 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)
  12. .. c:function:: 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)
  13. -----------
  14. DESCRIPTION
  15. -----------
  16. :c:func:`gearman_client_do` executes a single request to the gearmand
  17. server and waits for a reply.
  18. :c:func:`gearman_client_do_high` and :c:func:`gearman_client_do_low` are
  19. identical to :c:func:`gearman_client_do`, only they set the priority to
  20. either high or low.
  21. All of the functions will block until either a response or an error is
  22. returned.
  23. ------------
  24. RETURN VALUE
  25. ------------
  26. :c:func:`gearman_client_do` returns a pointer to a value that the caller must release. If ret_ptr is provided any errors that have occurred will be stored in it. Since a NULL/zero value is a valid value, you will always need to check ret_ptr if you are concerned with errors.
  27. -------
  28. Example
  29. -------
  30. .. literalinclude:: examples/gearman_client_do_example.c
  31. :language: c
  32. ----
  33. HOME
  34. ----
  35. To find out more information please check:
  36. `https://gearman.org/gearmand/ <https://gearman.org/gearmand/>`_
  37. .. seealso::
  38. :manpage:`gearmand(8)` :manpage:`libgearman(3)` :manpage:`gearman_strerror(3)`