File: gearman_client_do_high_background.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 (121 lines) | stat: -rw-r--r-- 3,788 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
.TH "GEARMAN_CLIENT_DO_HIGH_BACKGROUND" "3" "May 04, 2012" "0.33" "Gearmand"
.SH NAME
gearman_client_do_high_background \- 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_priority_t
.UNINDENT
.INDENT 0.0
.TP
.B gearman_return_t gearman_client_do_background(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, char\fI\ *job_handle\fP)
.UNINDENT
.sp
Changed in version 0.21: \fBGEARMAN_PAUSE\fP will no longer be returned. A do operation will now run until it has been submitted.
.INDENT 0.0
.TP
.B gearman_return_t gearman_client_do_high_background(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, gearman_job_handle_t\fI\ job_handle\fP)
.UNINDENT
.INDENT 0.0
.TP
.B gearman_return_t gearman_client_do_low_background(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, gearman_job_handle_t\fI\ job_handle\fP)
.UNINDENT
.SH DESCRIPTION
.sp
\fI\%gearman_client_do_background()\fP executes a single request to the
gearmand server and returns the status via \fBgearman_return_t\fP.
.sp
\fBgearman_client_add_task_high_background()\fP and \fBgearman_client_add_task_low_background()\fP are identical to
\fI\%gearman_client_do_background()\fP, only they set the \fI\%gearman_priority_t\fP to either high or low.
.sp
If job_handle is not NULL, it will be populated with the name of the job_handle
for the task created. The job handle needs to be the size of
\fBGEARMAN_JOB_HANDLE_SIZE\fP. Please see \fBgearman_job_handle_t\fP for more information.
.SH RETURN VALUE
.sp
\fBgearman_return_t\fP
.SH EXAMPLE
.sp
.nf
.ft C
#include <string.h>
#include <stdlib.h>
#include <stdio.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;
  }

  gearman_job_handle_t job_handle;
  gearman_return_t rc= gearman_client_do_background(client,
                                                    "reverse_function",
                                                    "unique_value",
                                                    "my string to reverse", strlen("my string to reverse"),
                                                    job_handle);

  if (gearman_success(rc))
  {
    // Make use of value
    printf("%s\en", job_handle);
  }

  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.
.\" 
.