We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
use futures_util::future::join_all; use mlua::prelude::*; #[tokio::main(flavor = "current_thread")] async fn main() -> LuaResult<()> { let lua = Lua::new(); let func = lua .load( r#" local x = 2 + 3 local y = x * 63 local z = string.len(x..", "..y) "#, ) .into_function()?; let mut cos: Vec<LuaAsyncThread<_, ()>> = Vec::new(); for i in 0..3 { let thread = lua.create_thread(func.clone())?; thread.set_hook(LuaHookTriggers::EVERY_LINE, move |_lua, _debug| { println!("test hook {}", i); Ok(LuaVmState::Continue) }); cos.push(thread.into_async(())); } join_all(cos).await; lua.remove_hook(); Ok(()) }
It not print test hook 0 and test hook 1
test hook 0
test hook 1
The text was updated successfully, but these errors were encountered:
set_hook is global in v0.6.
set_hook
v0.6
set hook for every coroutine can't work in new version. #347
Sorry, something went wrong.
I think global is more concise and more practical, even if it doesn't comply with Lua rules.
Successfully merging a pull request may close this issue.
It not print
test hook 0
andtest hook 1
The text was updated successfully, but these errors were encountered: