summaryrefslogtreecommitdiff
path: root/proxy.h
diff options
context:
space:
mode:
authordormando <dormando@rydia.net>2023-01-12 12:15:23 -0800
committerdormando <dormando@rydia.net>2023-01-12 13:50:55 -0800
commit6537cfe41ead9c81dd3e9c9f5d3929a050692cbd (patch)
tree021699f628b831dee45800ba913ec53ce88a8cf1 /proxy.h
parent0e87c6dd86d8a50ddd56fbce445fb18e498e7f5f (diff)
downloadmemcached-6537cfe41ead9c81dd3e9c9f5d3929a050692cbd.tar.gz
proxy: clean logic around lua yielding
We were duck typing the response code for a coroutine yield before. It would also pile random logic for overriding IO's in certain cases. This now makes everything explicit and more clear.
Diffstat (limited to 'proxy.h')
-rw-r--r--proxy.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/proxy.h b/proxy.h
index dce74f5..29eed86 100644
--- a/proxy.h
+++ b/proxy.h
@@ -80,6 +80,10 @@
#define MCP_BACKEND_UPVALUE 3
#define MCP_CONTEXT_UPVALUE 4
+#define MCP_YIELD_POOL 1
+#define MCP_YIELD_AWAIT 2
+#define MCP_YIELD_LOCAL 3
+
// all possible commands.
#define CMD_FIELDS \
X(CMD_MG) \
@@ -507,6 +511,7 @@ void mcp_request_attach(lua_State *L, mcp_request_t *rq, io_pending_proxy_t *p);
int mcp_request_render(mcp_request_t *rq, int idx, const char *tok, size_t len);
void proxy_lua_error(lua_State *L, const char *s);
void proxy_lua_ferror(lua_State *L, const char *fmt, ...);
+void proxy_out_errstring(mc_resp *resp, const char *str);
int _start_proxy_config_threads(proxy_ctx_t *ctx);
int proxy_thread_loadconf(proxy_ctx_t *ctx, LIBEVENT_THREAD *thr);