gearman_actions_t.rst 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. ====================================
  2. Client callbacks (gearman_actions_t)
  3. ====================================
  4. --------
  5. SYNOPSIS
  6. --------
  7. #include <libgearman/gearman.h>
  8. .. c:type:: gearman_actions_t
  9. .. c:type:: gearman_workload_fn
  10. .. c:type:: gearman_created_fn
  11. .. c:type:: gearman_data_fn
  12. .. c:type:: gearman_warning_fn
  13. .. c:type:: gearman_universal_status_fn
  14. .. c:type:: gearman_exception_fn
  15. .. c:type:: gearman_fail_fn
  16. .. c:type:: gearman_complete_fn
  17. .. c:function:: void gearman_client_set_workload_fn(gearman_client_st *client, gearman_workload_fn *function)
  18. .. c:function:: void gearman_client_set_created_fn(gearman_client_st *client, gearman_created_fn *function)
  19. .. c:function:: void gearman_client_set_data_fn(gearman_client_st *client, gearman_data_fn *function)
  20. .. c:function:: void gearman_client_set_warning_fn(gearman_client_st *client, gearman_warning_fn *function)
  21. .. c:function:: void gearman_client_set_status_fn(gearman_client_st *client, gearman_universal_status_fn *function)
  22. .. c:function:: void gearman_client_set_complete_fn(gearman_client_st *client, gearman_complete_fn *function)
  23. .. c:function:: void gearman_client_set_exception_fn(gearman_client_st *client, gearman_exception_fn *function)
  24. .. c:function:: void gearman_client_set_fail_fn(gearman_client_st *client, gearman_fail_fn *function)
  25. .. c:function:: void gearman_client_clear_fn(gearman_client_st *client)
  26. .. c:function:: const char *gearman_client_do_job_handle(gearman_client_st *client)
  27. Link to -lgearman
  28. -----------
  29. DESCRIPTION
  30. -----------
  31. Callbacks for client execution task states.
  32. :c:func:`gearman_client_set_data_fn` sets the callback function that will
  33. be called if server is to make a request to the client to provide more data.
  34. :c:func:`gearman_client_do_job_handle` gest the job handle for the running task. This should be used between repeated
  35. :c:func:`gearman_client_do` (and related) calls to get information.
  36. :c:func:`gearman_client_clear_fn` can be called to remove all existing
  37. :c:type:`gearman_actions_t` that have been set.
  38. :c:func:`gearman_client_set_created_fn`,
  39. :c:func:`gearman_client_set_data_fn`,
  40. :c:func:`gearman_client_set_warning_fn`,
  41. :c:func:`gearman_client_set_status_fn`,
  42. :c:func:`gearman_client_set_complete_fn`,
  43. :c:func:`gearman_client_set_exception_fn`, and
  44. :c:func:`gearman_client_set_fail_fn`, set callback functions for the
  45. different states of execution for a client request. Each request, ie
  46. a creation of :c:type:`gearman_task_st`, keeps a copy of callbacks when it
  47. is created.
  48. :c:func:`gearman_client_set_exception_fn` will only be called if exceptions are enabled on the server. You can do this by calling :c:func:`gearman_client_set_server_option`.
  49. An example of this::
  50. const char *EXCEPTIONS="exceptions";
  51. gearman_client_set_server_option(client, EXCEPTIONS, strlen(EXCEPTIONS));
  52. ------------
  53. RETURN VALUE
  54. ------------
  55. None
  56. .. seealso::
  57. :manpage:`gearmand(8)` :manpage:`libgearman(3)` :manpage:`gearman_client_error(3)` or :manpage:`gearman_worker_error(3)`