-
pub async fn redis_call(_lua: &Lua, arg: String) -> Result<String> {
// ??get transanction reference from lua ??
Ok(arg)
}
pub fn register_redis_func(lua: &Lua) -> Result<()> {
let globals = lua.globals();
// create redis.* commands table
let redis = lua.create_table()?;
let redis_call = lua.create_async_function(redis_call)?;
redis.set("call", redis_call)?;
// register to global table
globals.set("redis", redis)?;
// ??save transaction reference to lua ??
Ok(())
} Like the code shows, |
Beta Was this translation helpful? Give feedback.
Answered by
yongman
Apr 28, 2022
Replies: 2 comments 1 reply
-
what is "transaction reference"? |
Beta Was this translation helpful? Give feedback.
1 reply
-
I have used rust closure to capture the reference to solve this. |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
yongman
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I have used rust closure to capture the reference to solve this.
Mark this answered.