summaryrefslogtreecommitdiff
path: root/proxy.h
diff options
context:
space:
mode:
authordormando <dormando@rydia.net>2022-08-08 16:27:22 -0700
committerdormando <dormando@rydia.net>2022-08-24 22:32:40 -0700
commit6bcc5b8553d43f494e85ab3ec2ce789c38a3ca33 (patch)
treed49f62392b0b40419567014621877b5581885e72 /proxy.h
parent2bdf0ec3c8d89d7b75cb8ba7f1290cd937595669 (diff)
downloadmemcached-6bcc5b8553d43f494e85ab3ec2ce789c38a3ca33.tar.gz
proxy: mcp.attach(CMD, r, "tag")
allows using tagged listeners (ex; `-l tag[test]:127.0.0.1:11212`) to select a top level route for a function. expects there to not be dozens of listeners, but for a handful will be faster than a hash table lookup.
Diffstat (limited to 'proxy.h')
-rw-r--r--proxy.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/proxy.h b/proxy.h
index 1c5da3d..015c093 100644
--- a/proxy.h
+++ b/proxy.h
@@ -218,9 +218,15 @@ typedef struct {
pthread_mutex_t stats_lock; // used for rare global counters
} proxy_ctx_t;
+struct proxy_hook_tagged {
+ uint64_t tag;
+ int lua_ref;
+};
+
struct proxy_hook {
int lua_ref;
- bool is_lua; // pull the lua reference and call it as a lua function.
+ int tagcount;
+ struct proxy_hook_tagged *tagged; // array of possible tagged hooks.
};
// TODO (v2): some hash functions (crc?) might require initializers. If we run into