gearman_client_do_background.rst 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. ================================
  2. Issuing a single background task
  3. ================================
  4. --------
  5. SYNOPSIS
  6. --------
  7. #include <libgearman/gearman.h>
  8. .. c:type:: gearman_priority_t
  9. .. c:function:: gearman_return_t gearman_client_do_background(gearman_client_st *client, const char *function_name, const char *unique, const void *workload, size_t workload_size, char *job_handle)
  10. .. versionchanged:: 0.21
  11. :c:type:`GEARMAN_PAUSE` will no longer be returned. A do operation will now run until it has been submitted.
  12. .. c:function:: gearman_return_t gearman_client_do_high_background(gearman_client_st *client, const char *function_name, const char *unique, const void *workload, size_t workload_size, gearman_job_handle_t job_handle)
  13. .. c:function:: gearman_return_t gearman_client_do_low_background(gearman_client_st *client, const char *function_name, const char *unique, const void *workload, size_t workload_size, gearman_job_handle_t job_handle)
  14. -----------
  15. DESCRIPTION
  16. -----------
  17. :c:func:`gearman_client_do_background` executes a single request to the
  18. gearmand server and returns the status via :c:type:`gearman_return_t`.
  19. :c:func:`gearman_client_add_task_high_background` and :c:func:`gearman_client_add_task_low_background` are identical to
  20. :c:func:`gearman_client_do_background`, only they set the :c:type:`gearman_priority_t` to either high or low.
  21. If job_handle is not NULL, it will be populated with the name of the job_handle
  22. for the task created. The job handle needs to be the size of
  23. :c:macro:`GEARMAN_JOB_HANDLE_SIZE`. Please see :c:type:`gearman_job_handle_t` for more information.
  24. ------------
  25. RETURN VALUE
  26. ------------
  27. :c:type:`gearman_return_t`
  28. -------
  29. Example
  30. -------
  31. .. literalinclude:: examples/gearman_client_do_background_example.c
  32. :language: c
  33. ----
  34. HOME
  35. ----
  36. To find out more information please check:
  37. `https://gearman.org/gearmand/ <https://gearman.org/gearmand/>`_
  38. .. seealso::
  39. :manpage:`gearmand(8)` :manpage:`libgearman(3)` :manpage:`gearman_strerror(3)`