.\" Man page generated from reStructuredText. . . .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 .. .TH "GEARMAN_WORKER_SET_TIMEOUT" "3" "Jan 31, 2024" "1.1.20+ds" "Gearmand" .SH NAME gearman_worker_set_timeout \- Gearmand Documentation, http://gearman.info/ .SH SYNOPSIS .sp #include .INDENT 0.0 .TP .B type gearman_worker_st .UNINDENT .INDENT 0.0 .TP .B type gearman_worker_set_task_context_free_fn .UNINDENT .INDENT 0.0 .TP .B int gearman_worker_timeout(\fI\%gearman_worker_st\fP *worker) .UNINDENT .INDENT 0.0 .TP .B void gearman_worker_set_timeout(\fI\%gearman_worker_st\fP *worker, int timeout) .UNINDENT .INDENT 0.0 .TP .B void *gearman_worker_context(const \fI\%gearman_worker_st\fP *worker) .UNINDENT .INDENT 0.0 .TP .B void gearman_worker_set_context(\fI\%gearman_worker_st\fP *worker, void *context) .UNINDENT .INDENT 0.0 .TP .B void gearman_worker_set_workload_malloc_fn(\fI\%gearman_worker_st\fP *worker, \fI\%gearman_malloc_fn\fP *function, void *context) .UNINDENT .INDENT 0.0 .TP .B void gearman_worker_set_workload_free_fn(\fI\%gearman_worker_st\fP *worker, \fI\%gearman_free_fn\fP *function, void *context) .UNINDENT .INDENT 0.0 .TP .B \fI\%gearman_return_t\fP gearman_worker_wait(\fI\%gearman_worker_st\fP *worker) .UNINDENT .INDENT 0.0 .TP .B \fI\%gearman_return_t\fP gearman_worker_register(\fI\%gearman_worker_st\fP *worker, const char *function_name, \fI\%uint32_t\fP timeout) .UNINDENT .INDENT 0.0 .TP .B \fI\%gearman_return_t\fP gearman_worker_unregister(\fI\%gearman_worker_st\fP *worker, const char *function_name) .UNINDENT .INDENT 0.0 .TP .B \fI\%gearman_return_t\fP gearman_worker_unregister_all(\fI\%gearman_worker_st\fP *worker) .UNINDENT .INDENT 0.0 .TP .B void gearman_job_free_all(\fI\%gearman_worker_st\fP *worker) .UNINDENT .INDENT 0.0 .TP .B bool gearman_worker_function_exist(\fI\%gearman_worker_st\fP *worker, const char *function_name, \fI\%size_t\fP function_length) .UNINDENT .INDENT 0.0 .TP .B \fI\%gearman_return_t\fP gearman_worker_work(\fI\%gearman_worker_st\fP *worker) .UNINDENT .INDENT 0.0 .TP .B \fI\%gearman_job_st\fP *gearman_worker_grab_job(\fI\%gearman_worker_st\fP *worker, \fI\%gearman_job_st\fP *job, \fI\%gearman_return_t\fP *ret_ptr) .UNINDENT .sp Link with \-lgearman .SH DESCRIPTION .sp \fI\%gearman_worker_st\fP is used for worker communication with the server. .sp \fI\%gearman_worker_context()\fP and \fI\%gearman_worker_set_context()\fP can be used to store an arbitrary object for the user. .sp \fI\%gearman_worker_set_task_context_free_fn()\fP sets a trigger that will be called when a \fI\%gearman_task_st\fP is released. .sp \fI\%gearman_worker_timeout()\fP and \fI\%gearman_worker_set_timeout()\fP get and set the current timeout value, in milliseconds, for the worker. .sp \fI\%gearman_worker_function_exist()\fP is used to determine if a given worker has a specific function. .sp \fI\%gearman_worker_work()\fP have the worker execute against jobs until an error occurs. .sp \fI\%gearman_worker_grab_job()\fP Takes a job from one of the job servers. It is the responsibility of the caller to free the job once they are done. This interface is used in testing, and is very rarely the correct interface to program against. .sp Normally \fBmalloc(3)\fP and \fBfree(3)\fP are used for allocation and releasing workloads. \fI\%gearman_worker_set_workload_malloc_fn()\fP and \fI\%gearman_worker_set_workload_free_fn()\fP can be used to replace these with custom functions. .sp If you need to remove a function from the server you can call either \fI\%gearman_worker_unregister_all()\fP to remove all functions that the worker has told the \fBgearmand\fP server about, or you can use \fI\%gearman_worker_unregister()\fP to remove just a single function. .SH RETURN .sp Various .SH HOME .sp To find out more information please check: \fI\%http://gearman.info/\fP .SH SEE ALSO .sp \fBgearmand(8)\fP \fBlibgearman(3)\fP .SH AUTHOR Data Differential http://www.datadifferential.com/ .SH COPYRIGHT 2011-2024, Data Differential, http://www.datadifferential.com/ .\" Generated by docutils manpage writer. .