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
|
.TH "GEARMAN_CLIENT_DO" "3" "May 04, 2012" "0.33" "Gearmand"
.SH NAME
gearman_client_do \- 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 void *gearman_client_do(gearman_client_st\fI\ *client\fP, const char\fI\ *function_name\fP, const char\fI\ *unique\fP, const void\fI\ *workload\fP, size_t\fI\ workload_size\fP, size_t\fI\ *result_size\fP, gearman_return_t\fI\ *ret_ptr\fP)
.UNINDENT
.sp
Changed in version 0.21: \fBGEARMAN_PAUSE\fP will no longer be returned. A do operation will now run till completion or error.
.INDENT 0.0
.TP
.B void *gearman_client_do_high(gearman_client_st\fI\ *client\fP, const char\fI\ *function_name\fP, const char\fI\ *unique\fP, const void\fI\ *workload\fP, size_t\fI\ workload_size\fP, size_t\fI\ *result_size\fP, gearman_return_t\fI\ *ret_ptr\fP)
.UNINDENT
.INDENT 0.0
.TP
.B void *gearman_client_do_low(gearman_client_st\fI\ *client\fP, const char\fI\ *function_name\fP, const char\fI\ *unique\fP, const void\fI\ *workload\fP, size_t\fI\ workload_size\fP, size_t\fI\ *result_size\fP, gearman_return_t\fI\ *ret_ptr\fP)
.UNINDENT
.SH DESCRIPTION
.sp
\fI\%gearman_client_do()\fP executes a single request to the gearmand
server and waits for a reply.
.sp
\fI\%gearman_client_do_high()\fP and \fI\%gearman_client_do_low()\fP are
identical to \fI\%gearman_client_do()\fP, only they set the priority to
either high or low.
.sp
All of the functions will block until either a response or an error is
returned.
.SH RETURN VALUE
.sp
\fI\%gearman_client_do()\fP returns a pointer to a value that the caller must release. If ret_ptr is provided any errors that have occurred will be stored in it. Since a NULL/zero value is a valid value, you will always need to check ret_ptr if you are concerned with errors.
.SH EXAMPLE
.sp
.nf
.ft C
#include <string.h>
#include <stdlib.h>
#include <libgearman/gearman.h>
int main(void)
{
gearman_client_st *client= gearman_client_create(NULL);
gearman_return_t ret= gearman_client_add_server(client, "localhost", 0);
if (gearman_failed(ret))
{
return EXIT_FAILURE;
}
size_t result_size;
gearman_return_t rc;
void *value= gearman_client_do(client, "reverse_function", "unique_value",
"my string to reverse", strlen("my string to reverse"),
&result_size, &rc);
if (gearman_success(rc))
{
// Make use of value
}
free(value);
gearman_client_free(client);
return 0;
}
.ft P
.fi
.SH HOME
.sp
To find out more information please check:
\fI\%http://gearman.info/\fP
.IP "See also"
.sp
\fIgearmand(8)\fP \fIlibgearman(3)\fP \fIgearman_strerror(3)\fP
.RE
.SH AUTHOR
Data Differential http://www.datadifferential.com/
.SH COPYRIGHT
2012, Data Differential, http://www.datadifferential.com/
.\" Generated by docutils manpage writer.
.\"
.
|