-
-
Notifications
You must be signed in to change notification settings - Fork 181
Closed
Description
set_hook doesn't work properly when executing Lua with exec_async()
use anyhow::Result;
use mlua::{HookTriggers, Lua};
#[tokio::main]
async fn main() -> Result<()> {
let lua = Lua::new();
lua.set_hook(HookTriggers::EVERY_LINE, move |_lua, _debug| {
println!("test hook");
Ok(())
});
lua.load(
r#"
local x = 2 + 3
local y = x * 63
local z = string.len(x..", "..y)
"#,
)
.exec_async()
.await?;
lua.remove_hook();
Ok(())
}
Metadata
Metadata
Assignees
Labels
No labels