summaryrefslogtreecommitdiff
path: root/evrpc-internal.h
diff options
context:
space:
mode:
authorNiels Provos <provos@gmail.com>2007-11-03 22:51:26 +0000
committerNiels Provos <provos@gmail.com>2007-11-03 22:51:26 +0000
commit1d3a008af3433485256d8386366ceaac4d48af5f (patch)
tree6d325bb822595edd45d9d0736d18a95857453c65 /evrpc-internal.h
parent30ae40cc52300a79b8153db3ca40b77c544de76c (diff)
downloadlibevent-1d3a008af3433485256d8386366ceaac4d48af5f.tar.gz
provide hooks for outgoing pools; associate a base with a pool
svn:r468
Diffstat (limited to 'evrpc-internal.h')
-rw-r--r--evrpc-internal.h26
1 files changed, 22 insertions, 4 deletions
diff --git a/evrpc-internal.h b/evrpc-internal.h
index 8b8dd691..c900f959 100644
--- a/evrpc-internal.h
+++ b/evrpc-internal.h
@@ -41,16 +41,30 @@ struct evrpc_hook {
void *process_arg;
};
+TAILQ_HEAD(evrpc_hook_list, evrpc_hook);
+
+/*
+ * this is shared between the base and the pool, so that we can reuse
+ * the hook adding functions; we alias both evrpc_pool and evrpc_base
+ * to this common structure.
+ */
+struct _evrpc_hooks {
+ /* hooks for processing outbound and inbound rpcs */
+ struct evrpc_hook_list in_hooks;
+ struct evrpc_hook_list out_hooks;
+};
+
+#define input_hooks common.in_hooks
+#define output_hooks common.out_hooks
+
struct evrpc_base {
+ struct _evrpc_hooks common;
+
/* the HTTP server under which we register our RPC calls */
struct evhttp* http_server;
/* a list of all RPCs registered with us */
TAILQ_HEAD(evrpc_list, evrpc) registered_rpcs;
-
- /* hooks for processing outbound and inbound rpcs */
- TAILQ_HEAD(evrpc_hook_list, evrpc_hook) input_hooks;
- struct evrpc_hook_list output_hooks;
};
struct evrpc_req_generic;
@@ -58,6 +72,10 @@ void evrpc_reqstate_free(struct evrpc_req_generic* rpc_state);
/* A pool for holding evhttp_connection objects */
struct evrpc_pool {
+ struct _evrpc_hooks common;
+
+ struct event_base *base;
+
struct evconq connections;
int timeout;