Gearman Developer Documentation

libgearman-server/function.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_FUNCTION_H__
00015 #define __GEARMAN_SERVER_FUNCTION_H__
00016 
00017 #ifdef __cplusplus
00018 extern "C" {
00019 #endif
00020 
00034 struct gearman_server_function_st
00035 {
00036   struct {
00037     bool allocated;
00038   } options;
00039   uint32_t worker_count;
00040   uint32_t job_count;
00041   uint32_t job_total;
00042   uint32_t job_running;
00043   uint32_t max_queue_size;
00044   size_t function_name_size;
00045   gearman_server_st *server;
00046   gearman_server_function_st *next;
00047   gearman_server_function_st *prev;
00048   char *function_name;
00049   gearman_server_worker_st *worker_list;
00050   gearman_server_job_st *job_list[GEARMAN_JOB_PRIORITY_MAX];
00051   gearman_server_job_st *job_end[GEARMAN_JOB_PRIORITY_MAX];
00052 };
00053 
00057 GEARMAN_API
00058 gearman_server_function_st *
00059 gearman_server_function_get(gearman_server_st *server,
00060                             const char *function_name,
00061                             size_t function_name_size);
00062 
00066 GEARMAN_API
00067 gearman_server_function_st *
00068 gearman_server_function_create(gearman_server_st *server,
00069                                gearman_server_function_st *function);
00070 
00074 GEARMAN_API
00075 void gearman_server_function_free(gearman_server_function_st *function);
00076 
00079 #ifdef __cplusplus
00080 }
00081 #endif
00082 
00083 #endif /* __GEARMAN_SERVER_FUNCTION_H__ */