Gearman Developer Documentation

libgearman-server/worker.h
Go to the documentation of this file.
00001 /* Gearman server and library
00002  * Copyright (C) 2008 Brian Aker, Eric Day
00003  * All rights reserved.
00004  *
00005  * Use and distribution licensed under the BSD license.  See
00006  * the COPYING file in the parent directory for full text.
00007  */
00008 
00014 #ifndef __GEARMAN_SERVER_WORKER_H__
00015 #define __GEARMAN_SERVER_WORKER_H__
00016 
00017 #ifdef __cplusplus
00018 extern "C" {
00019 #endif
00020 
00024 struct gearman_server_worker_st
00025 {
00026   struct {
00027     bool allocated;
00028   } options;
00029   uint32_t job_count;
00030   uint32_t timeout;
00031   gearman_server_con_st *con;
00032   gearman_server_worker_st *con_next;
00033   gearman_server_worker_st *con_prev;
00034   gearman_server_function_st *function;
00035   gearman_server_worker_st *function_next;
00036   gearman_server_worker_st *function_prev;
00037   gearman_server_job_st *job_list;
00038 };
00039 
00053 GEARMAN_API
00054 gearman_server_worker_st *
00055 gearman_server_worker_add(gearman_server_con_st *con, const char *function_name,
00056                           size_t function_name_size, uint32_t timeout);
00057 
00061 GEARMAN_API
00062 gearman_server_worker_st *
00063 gearman_server_worker_create(gearman_server_con_st *con,
00064                              gearman_server_function_st *function,
00065                              gearman_server_worker_st *worker);
00066 
00070 GEARMAN_API
00071 void gearman_server_worker_free(gearman_server_worker_st *worker);
00072 
00075 #ifdef __cplusplus
00076 }
00077 #endif
00078 
00079 #endif /* __GEARMAN_SERVER_WORKER_H__ */