GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  GEARMAN_WORKER_DEFINE_FUNCTION (3)

NAME

gearman_worker_define_function - Gearmand Documentation, http://gearman.info/ \$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]

CONTENTS

Synopsis
Description
Return Value
Home
See Also
Author
Copyright

SYNOPSIS

#include <libgearman/gearman.h>
gearman_function_t
 

gearman_return_t gearman_worker_define_function(gearman_worker_st *worker, const char *function_name, const size_t function_name_length, const  gearman_function_t function, const uint32_t timeout, void *context)
 
gearman_function_fn
 
gearman_aggregator_fn
 

Link with -lgearman

DESCRIPTION

 gearman_worker_define_function() defines functions for a worker.

The interface is callback by design. When the server has a job for the worker,  gearman_function_fn is evoked with a gearman_job_st representing the job, and the context that was defined originally when the function was defined.

Results are sent back to the client by invoking gearman_job_send_data().

If the client specified an reducer function, then the output of the  gearman_function_fn will be sent to that function. You can split the work out to the reducer function by sending data multiple times with gearman_job_send_data().

If any errors are detected then the entire job is cancelled. The  gearman_aggregator_fn will be called when all mapped jobs have completed. The result of this function will be what is returned to the client.

The callback function needs to return one of the following errors:

GEARMAN_SUCCESS

The function was successful.

GEARMAN_FAIL

An error has occurred, the job we not processed, and the worker cannot continue.

GEARMAN_ERROR

A transient error has occurred, like a network failure, and the job can be restarted.

If a value other then the above are returned it is converted to a GEARMAN_FAIL and gearman_worker_work() returns GEARMAN_INVALID_ARGUMENT.

gearman_job_send_complete() and gearman_job_send_fail() cannot be used with any functions created with  gearman_worker_define_function().

RETURN VALUE

gearman_return_t

HOME

To find out more information please check:  http://gearman.info/

SEE ALSO

gearmand(8) libgearman(3) gearman_strerror(3) gearman_client_error gearman_client_execute_reduce

AUTHOR

Data Differential http://www.datadifferential.com/

COPYRIGHT

2011-2013, Data Differential, http://www.datadifferential.com/
Search for    or go to Top of page |  Section 3 |  Main Index


1.1.8 GEARMAN_WORKER_DEFINE_FUNCTION (3) June 06, 2013

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.