1GEARMAN_WORKER_ST(3)               Gearmand               GEARMAN_WORKER_ST(3)
2
3
4

NAME

6       gearman_worker_st - Gearmand Documentation, http://gearman.info/
7

SYNOPSIS

9       #include <libgearman/gearman.h>
10
11       gearman_worker_st
12
13       gearman_worker_set_task_context_free_fn
14
15       int gearman_worker_timeout(gearman_worker_st *worker)
16
17       void gearman_worker_set_timeout(gearman_worker_st *worker, int timeout)
18
19       void *gearman_worker_context(const gearman_worker_st *worker)
20
21       void  gearman_worker_set_context(gearman_worker_st *worker,  void *con‐
22       text)
23
24       void   gearman_worker_set_workload_malloc_fn(gearman_worker_st *worker,
25       gearman_malloc_fn *function, void *context)
26
27       void     gearman_worker_set_workload_free_fn(gearman_worker_st *worker,
28       gearman_free_fn *function, void *context)
29
30       gearman_return_t gearman_worker_wait(gearman_worker_st *worker)
31
32       gearman_return_t     gearman_worker_register(gearman_worker_st *worker,
33       const char *function_name, uint32_t timeout)
34
35       gearman_return_t   gearman_worker_unregister(gearman_worker_st *worker,
36       const char *function_name)
37
38       gearman_return_t                        gearman_worker_unregister_all(‐
39       gearman_worker_st *worker)
40
41       void gearman_job_free_all(gearman_worker_st *worker)
42
43       bool   gearman_worker_function_exist(gearman_worker_st *worker,   const
44       char *function_name, size_t function_length)
45
46       gearman_return_t gearman_worker_work(gearman_worker_st *worker)
47
48       gearman_job_st      *gearman_worker_grab_job(gearman_worker_st *worker,
49       gearman_job_st *job, gearman_return_t *ret_ptr)
50
51       Link with -lgearman
52

DESCRIPTION

54       gearman_worker_st is used for worker communication with the server.
55
56       gearman_worker_context()  and  gearman_worker_set_context() can be used
57       to store an arbitrary object for the user.
58
59       gearman_worker_set_task_context_free_fn() sets a trigger that  will  be
60       called when a gearman_task_st is released.
61
62       gearman_worker_timeout()  and  gearman_worker_set_timeout() get and set
63       the current timeout value, in milliseconds, for the worker.
64
65       gearman_worker_function_exist() is used to determine if a given  worker
66       has a specific function.
67
68       gearman_worker_work()  have  the  worker  execute against jobs until an
69       error occurs.
70
71       gearman_worker_grab_job() Takes a job from one of the job  servers.  It
72       is the responsibility of the caller to free the job once they are done.
73       This interface is used in testing,  and  is  very  rarely  the  correct
74       interface to program against.
75
76       Normally  malloc(3)  and  free(3) are used for allocation and releasing
77       workloads.         gearman_worker_set_workload_malloc_fn()          and
78       gearman_worker_set_workload_free_fn() can be used to replace these with
79       custom functions.
80
81       If you need to remove a function from the server you  can  call  either
82       gearman_worker_unregister_all() to remove all functions that the worker
83       has   told   the   gearmand   server   about,   or    you    can    use
84       gearman_worker_unregister() to remove just a single function.
85

RETURN

87       Various
88

HOME

90       To find out more information please check: http://gearman.info/
91

SEE ALSO

93       gearmand(8) libgearman(3)
94

AUTHOR

96       Data Differential http://www.datadifferential.com/
97
99       2011-2014, Data Differential, http://www.datadifferential.com/
100
101
102
103
1041.1.18                         December 11, 2017          GEARMAN_WORKER_ST(3)
Impressum