diff options
author | dormando <dormando@rydia.net> | 2022-11-22 22:52:08 -0800 |
---|---|---|
committer | dormando <dormando@rydia.net> | 2022-12-01 22:07:32 -0800 |
commit | 1ba5df8410e7ccc035390438e45b26c2d11ede5c (patch) | |
tree | ff0e1b06e15c411d8418a94e762cc7744fd12f07 /t/startfile.lua | |
parent | 683bb98a55ba19f69c4e2a60b9104ed2edc971c3 (diff) | |
download | memcached-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 't/startfile.lua')
-rw-r--r-- | t/startfile.lua | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/t/startfile.lua b/t/startfile.lua index 9f16434..96a864b 100644 --- a/t/startfile.lua +++ b/t/startfile.lua @@ -212,10 +212,11 @@ function setinvalidate_factory(zones, local_zone) -- example of new request from existing request -- note this isn't trimming the key so it'll make a weird one. -- local dr = new_req("set /bar/" .. r:key() .. " 0 0 " .. r:token(5) .. "\r\n", r) - for _, zone in pairs(far_zones) do - -- NOTE: can check/do things on the specific response here. - zone(dr) - end + -- AWAIT_BACKGROUND allows us to immediately resume processing, executing the + -- delete requests in the background. + mcp.await(dr, far_zones, 0, mcp.AWAIT_BACKGROUND) + --mcp.await(dr, far_zones, 0) + mcp.log_req(r, res, "setinvalidate") -- time against the original request, since we have no result. end -- use original response for client, not DELETE's response. -- else client won't understand. |