1
.TH "GEARMAN_TASK_CONTEXT" "3" "September 14, 2012" "0.38" "Gearmand"
3
gearman_task_context \- Gearmand Documentation, http://gearman.info/
5
.nr rst2man-indent-level 0
9
level \\n[rst2man-indent-level]
10
level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
17
.\" .rstReportMargin pre:
19
. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
20
. nr rst2man-indent-level +1
21
.\" .rstReportMargin post:
25
.\" indent \\n[an-margin]
26
.\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
27
.nr rst2man-indent-level -1
28
.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
29
.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
31
.\" Man page generated from reStructeredText.
35
#include <libgearman/gearman.h>
42
.B void gearman_task_free(\fI\%gearman_task_st\fP\fI\ *task\fP)
46
.B void *gearman_task_context(const \fI\%gearman_task_st\fP\fI\ *task\fP)
50
.B void gearman_task_set_context(\fI\%gearman_task_st\fP\fI\ *task\fP, void\fI\ *context\fP)
54
.B const char *gearman_task_function_name(const \fI\%gearman_task_st\fP\fI\ *task\fP)
58
.B const char *gearman_task_unique(const \fI\%gearman_task_st\fP\fI\ *task\fP)
62
.B const char *gearman_task_job_handle(const \fI\%gearman_task_st\fP\fI\ *task\fP)
66
.B bool gearman_task_is_known(const \fI\%gearman_task_st\fP\fI\ *task\fP)
70
.B bool gearman_task_is_running(const \fI\%gearman_task_st\fP\fI\ *task\fP)
74
.B uint32_t gearman_task_numerator(const \fI\%gearman_task_st\fP\fI\ *task\fP)
78
.B uint32_t gearman_task_denominator(const \fI\%gearman_task_st\fP\fI\ *task\fP)
82
.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)
86
.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)
90
.B const void *gearman_task_data(const \fI\%gearman_task_st\fP\fI\ *task\fP)
94
.B size_t gearman_task_data_size(const \fI\%gearman_task_st\fP\fI\ *task\fP)
98
.B void *gearman_task_take_data(\fI\%gearman_task_st\fP\fI\ *task\fP, size_t\fI\ *data_size\fP)
102
.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)
106
.B const char *gearman_task_error(const \fI\%gearman_task_st\fP\fI\ *task\fP)
112
.B gearman_return_t gearman_task_return(const \fI\%gearman_task_st\fP\fI\ *task\fP)
120
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.
122
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.
124
\fBgearman_client_add_task_status()\fP can also create \fI\%gearman_task_st\fP, these tasks will be used to
125
monitor a previously created \fI\%gearman_task_st\fP.
127
\fI\%gearman_task_free()\fP is used to free a task. This only needs to be
128
done if a task was created with a preallocated structure or if you want to clean up the memory of a specific task.
130
\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.
132
\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.
134
\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.
136
\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.
138
\fI\%gearman_task_error()\fP return the last error message that the
139
\fI\%gearman_task_st\fP encountered. \fI\%gearman_task_return()\fP
140
return the last \fBgearman_return_t\fP stored. A value of
141
\fBGEARMAN_UNKNOWN_STATE\fP means that the task has not been submitted to
142
server yet, or that no function was available if the job has been submitted.
145
Various. Values that are returned by \fI\%gearman_task_take_data()\fP must have \fIfree(3)\fP called on them.
148
To find out more information please check:
149
\fI\%http://gearman.info/\fP
152
\fIgearmand(8)\fP \fIlibgearman(3)\fP
154
Data Differential http://www.datadifferential.com/
156
2012, Data Differential, http://www.datadifferential.com/
157
.\" Generated by docutils manpage writer.