Created
April 19, 2020 19:10
-
-
Save leandromoreira/2e6b5c223afe5f24303eaa06d5776dec to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local wrapper_loadstring = function(str_code) | |
local api_fun, err = loadstring("return function (edge_computing) " .. str_code .. " end") | |
if api_fun then return api_fun() else return api_fun, err end | |
end | |
-- ... compile cu["code] = wrapper_loadstring(raw_code) | |
local status, ret = pcall(cu["code"], {redis_client=edge_computing.redis_client}) | |
-- CU in Redis -- | |
-- set authentication "rewrite||local resp, err = edge_computing.redis_client:incr(\"key\") \n ngx.log(ngx.ERR, \" >>>> \", resp) \n" | |
local resp, err = edge_computing.redis_client:incr("key") | |
ngx.log(ngx.ERR, " >>>> ", resp) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment