File: gearman_task_take_data.3

package info (click to toggle)
gearmand 0.33-2
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 6,396 kB
  • sloc: cpp: 32,756; sh: 11,771; ansic: 4,962; makefile: 102
file content (159 lines) | stat: -rw-r--r-- 5,687 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
.TH "GEARMAN_TASK_TAKE_DATA" "3" "May 04, 2012" "0.33" "Gearmand"
.SH NAME
gearman_task_take_data \- Gearmand Documentation, http://gearman.info/
.
.nr rst2man-indent-level 0
.
.de1 rstReportMargin
\\$1 \\n[an-margin]
level \\n[rst2man-indent-level]
level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
-
\\n[rst2man-indent0]
\\n[rst2man-indent1]
\\n[rst2man-indent2]
..
.de1 INDENT
.\" .rstReportMargin pre:
. RS \\$1
. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
. nr rst2man-indent-level +1
.\" .rstReportMargin post:
..
.de UNINDENT
. RE
.\" indent \\n[an-margin]
.\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
.nr rst2man-indent-level -1
.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
..
.\" Man page generated from reStructeredText.
.
.SH SYNOPSIS
.sp
#include <libgearman/gearman.h>
.INDENT 0.0
.TP
.B gearman_task_st
.UNINDENT
.INDENT 0.0
.TP
.B void gearman_task_free(\fI\%gearman_task_st\fP\fI\ *task\fP)
.UNINDENT
.INDENT 0.0
.TP
.B void *gearman_task_context(const \fI\%gearman_task_st\fP\fI\ *task\fP)
.UNINDENT
.INDENT 0.0
.TP
.B void gearman_task_set_context(\fI\%gearman_task_st\fP\fI\ *task\fP, void\fI\ *context\fP)
.UNINDENT
.INDENT 0.0
.TP
.B const char *gearman_task_function_name(const \fI\%gearman_task_st\fP\fI\ *task\fP)
.UNINDENT
.INDENT 0.0
.TP
.B const char *gearman_task_unique(const \fI\%gearman_task_st\fP\fI\ *task\fP)
.UNINDENT
.INDENT 0.0
.TP
.B const char *gearman_task_job_handle(const \fI\%gearman_task_st\fP\fI\ *task\fP)
.UNINDENT
.INDENT 0.0
.TP
.B bool gearman_task_is_known(const \fI\%gearman_task_st\fP\fI\ *task\fP)
.UNINDENT
.INDENT 0.0
.TP
.B bool gearman_task_is_running(const \fI\%gearman_task_st\fP\fI\ *task\fP)
.UNINDENT
.INDENT 0.0
.TP
.B uint32_t gearman_task_numerator(const \fI\%gearman_task_st\fP\fI\ *task\fP)
.UNINDENT
.INDENT 0.0
.TP
.B uint32_t gearman_task_denominator(const \fI\%gearman_task_st\fP\fI\ *task\fP)
.UNINDENT
.INDENT 0.0
.TP
.B void gearman_task_give_workload(\fI\%gearman_task_st\fP\fI\ *task\fP, const void\fI\ *workload\fP, size_t\fI\ workload_size\fP)
.UNINDENT
.INDENT 0.0
.TP
.B size_t gearman_task_send_workload(\fI\%gearman_task_st\fP\fI\ *task\fP, const void\fI\ *workload\fP, size_t\fI\ workload_size\fP, gearman_return_t\fI\ *ret_ptr\fP)
.UNINDENT
.INDENT 0.0
.TP
.B const void *gearman_task_data(const \fI\%gearman_task_st\fP\fI\ *task\fP)
.UNINDENT
.INDENT 0.0
.TP
.B size_t gearman_task_data_size(const \fI\%gearman_task_st\fP\fI\ *task\fP)
.UNINDENT
.INDENT 0.0
.TP
.B void *gearman_task_take_data(\fI\%gearman_task_st\fP\fI\ *task\fP, size_t\fI\ *data_size\fP)
.UNINDENT
.INDENT 0.0
.TP
.B size_t gearman_task_recv_data(\fI\%gearman_task_st\fP\fI\ *task\fP, void\fI\ *data\fP, size_t\fI\ data_size\fP, gearman_return_t\fI\ *ret_ptr\fP)
.UNINDENT
.INDENT 0.0
.TP
.B const char *gearman_task_error(const \fI\%gearman_task_st\fP\fI\ *task\fP)
.UNINDENT
.sp
New in version 0.21.
.INDENT 0.0
.TP
.B gearman_return_t gearman_task_return(const \fI\%gearman_task_st\fP\fI\ *task\fP)
.UNINDENT
.sp
New in version 0.21.
.sp
Link with \-lgearman
.SH DESCRIPTION
.sp
A \fI\%gearman_task_st\fP represents a \fItask\fP.  Work that is sent by a \fIclient\fP to a gearman server is seen as a task (a \fIworker\fP recieves a task in the form of a \fIjob\fP.
.sp
Tasks, i.e. \fI\%gearman_task_st\fP are created by calling either \fBgearman_execute()\fP, \fBgearman_client_add_task()\fP, or \fBgearman_client_add_task_background()\fP.
.sp
\fBgearman_client_add_task_status()\fP can also create \fI\%gearman_task_st\fP, these tasks will be used to
monitor a previously created \fI\%gearman_task_st\fP.
.sp
\fI\%gearman_task_free()\fP is used to free a task. This only needs to be
done if a task was created with a preallocated structure or if you want to clean up the memory of a specific task.
.sp
\fI\%gearman_task_set_context()\fP sets the given context of the \fI\%gearman_task_st\fP. The context can be used to pass information to a \fI\%gearman_task_st\fP.
.sp
\fI\%gearman_task_context()\fP returns the context that was used in the creation of the \fI\%gearman_task_st\fP (or that was set with \fI\%gearman_task_set_context()\fP.
.sp
\fI\%gearman_task_data()\fP returns the current data that has been returned to the task. \fI\%gearman_task_data_size()\fP will give you the size of the value. \fI\%gearman_task_take_data()\fP is the same as \fI\%gearman_task_data()\fP but the value that is returned must be freed by the client (\fIfree(3)\fP). \fI\%gearman_task_recv_data()\fP can be used with pre\-allocated buffers.
.sp
\fI\%gearman_task_is_known()\fP, \fI\%gearman_task_is_running()\fP, \fI\%gearman_task_numerator()\fP, and \fI\%gearman_task_denominator()\fP, return values related to the last status update that was made to the \fI\%gearman_task_st\fP. They do not cause the \fI\%gearman_task_st\fP to update itself.
.sp
\fI\%gearman_task_error()\fP return the last error message that the
\fI\%gearman_task_st\fP encountered. \fI\%gearman_task_return()\fP
return the last \fBgearman_return_t\fP stored. A value of
\fBGEARMAN_UNKNOWN_STATE\fP means that the task has not been submitted to
server yet, or that no function was available if the job has been submitted.
.SH RETURN VALUE
.sp
Various. Values that are returned by \fI\%gearman_task_take_data()\fP must have \fIfree(3)\fP called on them.
.SH HOME
.sp
To find out more information please check:
\fI\%http://gearman.info/\fP
.SH SEE ALSO
.sp
\fIgearmand(8)\fP \fIlibgearman(3)\fP
.SH AUTHOR
Data Differential http://www.datadifferential.com/
.SH COPYRIGHT
2012, Data Differential, http://www.datadifferential.com/
.\" Generated by docutils manpage writer.
.\" 
.