1
.TH "GEARMAN_WORKER_CREATE" "3" "April 17, 2012" "0.32" "Gearmand"
1
.TH "GEARMAN_WORKER_CREATE" "3" "May 03, 2012" "0.33" "Gearmand"
3
3
gearman_worker_create \- Gearmand Documentation, http://gearman.info/
35
35
#include <libgearman/gearman.h>
38
.B gearman_worker_st *gearman_worker_create(gearman_worker_st *client);
42
.B gearman_worker_st *gearman_worker_clone(gearman_worker_st *client, const gearman_worker_st *from);
46
.B void gearman_worker_free(gearman_worker_st *client);
38
.B gearman_worker_st *gearman_worker_create(gearman_worker_st\fI\ *client\fP)
42
.B gearman_worker_st *gearman_worker_clone(gearman_worker_st\fI\ *client\fP, const gearman_worker_st\fI\ *from\fP)
46
.B void gearman_worker_free(gearman_worker_st\fI\ *client\fP)
49
49
Link with \-lgearman
52
52
gearman_worker_create() is used to create a \fBgearman_worker_st\fP structure that will then
53
53
be used by other libgearman(3) client functions to communicate with the server. You
54
should either pass a statically declared \fBgearman_worker_st\fP to gearman_worker_create() or
54
should either pass a statically declared \fBgearman_worker_st\fP to gearman_worker_create) or
55
55
a NULL. If a NULL passed in then a structure is allocated for you.
57
\fBgearman_worker_clone()\fP is similar to \fBgearman_worker_create()\fP but it copies the
57
\fI\%gearman_worker_clone()\fP is similar to \fI\%gearman_worker_create()\fP but it copies the
58
58
defaults and list of servers from the source \fBgearman_worker_st\fP. If you pass a null as
59
59
the argument for the source to clone, it is the same as a call to gearman_worker_create().
60
60
If the destination argument is NULL a \fBgearman_worker_st\fP will be allocated for you.
62
62
To clean up memory associated with a \fBgearman_worker_st\fP structure you should pass
63
it to \fBgearman_worker_free()\fP when you are finished using it. \fBgearman_worker_free()\fP is
63
it to \fI\%gearman_worker_free()\fP when you are finished using it. \fI\%gearman_worker_free\fP is
64
64
the only way to make sure all memory is deallocated when you finish using
67
You may wish to avoid using \fBgearman_worker_create()\fP or \fBgearman_worker_clone()\fP with a
67
You may wish to avoid using \fI\%gearman_worker_create()\fP or \fI\%gearman_worker_clone()\fP with a
68
68
stack based allocation, ie the first parameter. The most common issues related to ABI safety involve
69
69
heap allocated structures.
72
\fBgearman_worker_create()\fP returns a pointer to the \fBgearman_worker_st\fP that was created
72
\fI\%gearman_worker_create()\fP returns a pointer to the \fBgearman_worker_st\fP that was created
73
73
(or initialized). On an allocation failure, it returns NULL.
75
\fBgearman_worker_clone()\fP returns a pointer to the \fBgearman_worker_st\fP that was created
75
\fI\%gearman_worker_clone()\fP returns a pointer to the \fBgearman_worker_st\fP that was created
76
76
(or initialized). On an allocation failure, it returns NULL.