~mordred/gearmand/cancel-job

« back to all changes in this revision

Viewing changes to docs/man/gearman_worker_add_function.3

  • Committer: Brian Aker
  • Date: 2012-05-04 03:46:04 UTC
  • Revision ID: brian@tangent.org-20120504034604-5t22ae4v2o45zjkq
Update for libtest, documentation, and fix for root bzr dir.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
.TH "GEARMAN_WORKER_ADD_FUNCTION" "3" "April 17, 2012" "0.32" "Gearmand"
 
1
.TH "GEARMAN_WORKER_ADD_FUNCTION" "3" "May 03, 2012" "0.33" "Gearmand"
2
2
.SH NAME
3
3
gearman_worker_add_function \- Gearmand Documentation, http://gearman.info/
4
4
.
39
39
.UNINDENT
40
40
.INDENT 0.0
41
41
.TP
42
 
.B int gearman_worker_timeout(gearman_worker_st *worker);
43
 
.UNINDENT
44
 
.INDENT 0.0
45
 
.TP
46
 
.B void gearman_worker_set_timeout(gearman_worker_st *worker, int timeout);
47
 
.UNINDENT
48
 
.INDENT 0.0
49
 
.TP
50
 
.B void *gearman_worker_context(const gearman_worker_st *worker);
51
 
.UNINDENT
52
 
.INDENT 0.0
53
 
.TP
54
 
.B void gearman_worker_set_context(gearman_worker_st *worker, void *context);
55
 
.UNINDENT
56
 
.INDENT 0.0
57
 
.TP
58
 
.B void gearman_worker_set_workload_malloc_fn(gearman_worker_st *worker, gearman_malloc_fn *function, void *context);
59
 
.UNINDENT
60
 
.INDENT 0.0
61
 
.TP
62
 
.B void gearman_worker_set_workload_free_fn(gearman_worker_st *worker, gearman_free_fn *function, void *context);
63
 
.UNINDENT
64
 
.INDENT 0.0
65
 
.TP
66
 
.B gearman_return_t gearman_worker_wait(gearman_worker_st *worker);
67
 
.UNINDENT
68
 
.INDENT 0.0
69
 
.TP
70
 
.B gearman_return_t gearman_worker_register(gearman_worker_st *worker, const char *function_name, uint32_t timeout);
71
 
.UNINDENT
72
 
.INDENT 0.0
73
 
.TP
74
 
.B gearman_return_t gearman_worker_unregister(gearman_worker_st *worker, const char *function_name);
75
 
.UNINDENT
76
 
.INDENT 0.0
77
 
.TP
78
 
.B gearman_return_t gearman_worker_unregister_all(gearman_worker_st *worker);
79
 
.UNINDENT
80
 
.INDENT 0.0
81
 
.TP
82
 
.B gearman_job_st *gearman_worker_grab_job(gearman_worker_st *worker, gearman_job_st *job, gearman_return_t *ret_ptr);
83
 
.UNINDENT
84
 
.INDENT 0.0
85
 
.TP
86
 
.B void gearman_job_free_all(gearman_worker_st *worker);
87
 
.UNINDENT
88
 
.INDENT 0.0
89
 
.TP
90
 
.B bool gearman_worker_function_exist(gearman_worker_st *worker, const char *function_name, size_t function_length);
91
 
.UNINDENT
92
 
.INDENT 0.0
93
 
.TP
94
 
.B gearman_return_t gearman_worker_work(gearman_worker_st *worker);
 
42
.B gearman_worker_set_task_context_free_fn
 
43
.UNINDENT
 
44
.INDENT 0.0
 
45
.TP
 
46
.B int gearman_worker_timeout(\fI\%gearman_worker_st\fP\fI\ *worker\fP)
 
47
.UNINDENT
 
48
.INDENT 0.0
 
49
.TP
 
50
.B void gearman_worker_set_timeout(\fI\%gearman_worker_st\fP\fI\ *worker\fP, int\fI\ timeout\fP)
 
51
.UNINDENT
 
52
.INDENT 0.0
 
53
.TP
 
54
.B void *gearman_worker_context(const \fI\%gearman_worker_st\fP\fI\ *worker\fP)
 
55
.UNINDENT
 
56
.INDENT 0.0
 
57
.TP
 
58
.B void gearman_worker_set_context(\fI\%gearman_worker_st\fP\fI\ *worker\fP, void\fI\ *context\fP)
 
59
.UNINDENT
 
60
.INDENT 0.0
 
61
.TP
 
62
.B void gearman_worker_set_workload_malloc_fn(\fI\%gearman_worker_st\fP\fI\ *worker\fP, gearman_malloc_fn\fI\ *function\fP, void\fI\ *context\fP)
 
63
.UNINDENT
 
64
.INDENT 0.0
 
65
.TP
 
66
.B void gearman_worker_set_workload_free_fn(\fI\%gearman_worker_st\fP\fI\ *worker\fP, gearman_free_fn\fI\ *function\fP, void\fI\ *context\fP)
 
67
.UNINDENT
 
68
.INDENT 0.0
 
69
.TP
 
70
.B gearman_return_t gearman_worker_wait(\fI\%gearman_worker_st\fP\fI\ *worker\fP)
 
71
.UNINDENT
 
72
.INDENT 0.0
 
73
.TP
 
74
.B gearman_return_t gearman_worker_register(\fI\%gearman_worker_st\fP\fI\ *worker\fP, const char\fI\ *function_name\fP, uint32_t\fI\ timeout\fP)
 
75
.UNINDENT
 
76
.INDENT 0.0
 
77
.TP
 
78
.B gearman_return_t gearman_worker_unregister(\fI\%gearman_worker_st\fP\fI\ *worker\fP, const char\fI\ *function_name\fP)
 
79
.UNINDENT
 
80
.INDENT 0.0
 
81
.TP
 
82
.B gearman_return_t gearman_worker_unregister_all(\fI\%gearman_worker_st\fP\fI\ *worker\fP)
 
83
.UNINDENT
 
84
.INDENT 0.0
 
85
.TP
 
86
.B gearman_job_st *gearman_worker_grab_job(\fI\%gearman_worker_st\fP\fI\ *worker\fP, gearman_job_st\fI\ *job\fP, gearman_return_t\fI\ *ret_ptr\fP)
 
87
.UNINDENT
 
88
.INDENT 0.0
 
89
.TP
 
90
.B void gearman_job_free_all(\fI\%gearman_worker_st\fP\fI\ *worker\fP)
 
91
.UNINDENT
 
92
.INDENT 0.0
 
93
.TP
 
94
.B bool gearman_worker_function_exist(\fI\%gearman_worker_st\fP\fI\ *worker\fP, const char\fI\ *function_name\fP, size_t\fI\ function_length\fP)
 
95
.UNINDENT
 
96
.INDENT 0.0
 
97
.TP
 
98
.B gearman_return_t gearman_worker_work(\fI\%gearman_worker_st\fP\fI\ *worker\fP)
95
99
.UNINDENT
96
100
.sp
97
101
Link with \-lgearman
99
103
.sp
100
104
\fI\%gearman_worker_st\fP is used for worker communication with the server.
101
105
.sp
102
 
\fBgearman_worker_context()\fP and \fBgearman_worker_set_context()\fP can be used to store an arbitrary object for the user.
103
 
.sp
104
 
\fBgearman_worker_set_task_context_free_fn()\fP sets a trigger that will be called when a \fBgearman_task_st\fP is released.
105
 
.sp
106
 
\fBgearman_worker_timeout()\fP and \fBgearman_worker_set_timeout()\fP get and set the current timeout value, in milliseconds, for the worker.
107
 
.sp
108
 
\fBgearman_worker_function_exist()\fP is used to determine if a given worker has a specific function.
109
 
.sp
110
 
Normally \fImalloc(3)\fP and \fIfree(3)\fP are used for allocation and releasing workloads. \fBgearman_worker_set_workload_malloc_fn()\fP and \fBgearman_worker_set_workload_free_fn()\fP can be used to replace these with custom functions.
111
 
.sp
112
 
If you need to remove a function from the server you can call either \fBgearman_worker_unregister_all()\fP to remove all functions that the worker has told the \fBgearmand\fP server about, or you can use \fBgearman_worker_unregister()\fP to remove just a single function.
 
106
\fI\%gearman_worker_context()\fP and \fI\%gearman_worker_set_context()\fP can be used to store an arbitrary object for the user.
 
107
.sp
 
108
\fI\%gearman_worker_set_task_context_free_fn()\fP sets a trigger that will be called when a \fBgearman_task_st\fP is released.
 
109
.sp
 
110
\fI\%gearman_worker_timeout()\fP and \fI\%gearman_worker_set_timeout()\fP get and set the current timeout value, in milliseconds, for the worker.
 
111
.sp
 
112
\fI\%gearman_worker_function_exist()\fP is used to determine if a given worker has a specific function.
 
113
.sp
 
114
Normally \fImalloc(3)\fP and \fIfree(3)\fP are used for allocation and releasing workloads. \fI\%gearman_worker_set_workload_malloc_fn()\fP and \fI\%gearman_worker_set_workload_free_fn()\fP can be used to replace these with custom functions.
 
115
.sp
 
116
If you need to remove a function from the server you can call either \fI\%gearman_worker_unregister_all()\fP to remove all functions that the worker has told the \fBgearmand\fP server about, or you can use \fI\%gearman_worker_unregister()\fP to remove just a single function.
113
117
.SH RETURN
114
118
.sp
115
119
Various