summaryrefslogtreecommitdiff
path: root/proxy.h
diff options
context:
space:
mode:
authordormando <dormando@rydia.net>2022-11-22 22:52:08 -0800
committerdormando <dormando@rydia.net>2022-12-01 22:07:32 -0800
commit1ba5df8410e7ccc035390438e45b26c2d11ede5c (patch)
treeff0e1b06e15c411d8418a94e762cc7744fd12f07 /proxy.h
parent683bb98a55ba19f69c4e2a60b9104ed2edc971c3 (diff)
downloadmemcached-1ba5df8410e7ccc035390438e45b26c2d11ede5c.tar.gz
proxy: add mcp.AWAIT_BACKGROUND
mcp.await(request, pools, 0, mcp.AWAIT_BACKGROUND) will, instead of waiting on any request to return, simply return an empty table as soon as the background requests are dispatched.
Diffstat (limited to 'proxy.h')
-rw-r--r--proxy.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/proxy.h b/proxy.h
index f7647d6..66b4748 100644
--- a/proxy.h
+++ b/proxy.h
@@ -401,6 +401,7 @@ struct _io_pending_proxy_t {
bool ascii_multiget; // passed on from mcp_r_t
bool is_await; // are we an await object?
bool await_first; // are we the main route for an await object?
+ bool await_background; // dummy IO for backgrounded awaits
};
// Note: does *be have to be a sub-struct? how stable are userdata pointers?
@@ -444,6 +445,7 @@ enum mcp_await_e {
AWAIT_OK, // any non-error response
AWAIT_FIRST, // return the result from the first pool
AWAIT_FASTGOOD, // returns on first hit or majority non-error
+ AWAIT_BACKGROUND, // returns as soon as background jobs are dispatched
};
int mcplib_await(lua_State *L);
int mcplib_await_run(conn *c, mc_resp *resp, lua_State *L, int coro_ref);