gearman_client_add_task.rst 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. ==============
  2. Creating tasks
  3. ==============
  4. --------
  5. SYNOPSIS
  6. --------
  7. #include <libgearman/gearman.h>
  8. .. c:function:: gearman_task_st *gearman_client_add_task(gearman_client_st *client, gearman_task_st *task, void *context, const char *function_name, const char *unique, const void *workload, size_t workload_size, gearman_return_t *ret_ptr)
  9. .. c:function:: gearman_task_st *gearman_client_add_task_high(gearman_client_st *client, gearman_task_st *task, void *context, const char *function_name, const char *unique, const void *workload, size_t workload_size, gearman_return_t *ret_ptr)
  10. .. c:function:: gearman_task_st *gearman_client_add_task_low(gearman_client_st *client, gearman_task_st *task, void *context, const char *function_name, const char *unique, const void *workload, size_t workload_size, gearman_return_t *ret_ptr)
  11. Link with -lgearman
  12. -----------
  13. DESCRIPTION
  14. -----------
  15. :c:func:`gearman_client_add_task` creates a task and adds it to the given :c:type:`gearman_client_st`. Execution of the task does not begin until :c:func:`gearman_client_run_tasks` is called.
  16. If the unique value is not set, then a unique will be assigned.
  17. :c:func:`gearman_client_add_task_high` and :c:func:`gearman_client_add_task_low` are identical to :c:func:`gearman_client_do`, only they set the priority to either high or low.
  18. ------------
  19. RETURN VALUE
  20. ------------
  21. The :c:type:`gearman_task_st` is created and a pointer to it is returned. On error NULL is returned and ret_ptr is set with a :c:type:`gearman_return_t`.
  22. ----
  23. HOME
  24. ----
  25. To find out more information please check:
  26. `https://gearman.org/gearmand/ <https://gearman.org/gearmand/>`_
  27. .. seealso::
  28. :manpage:`gearmand(8)` :manpage:`libgearman(3)`