Skip to content

Commit

Permalink
Use newer runtime version
Browse files Browse the repository at this point in the history
  • Loading branch information
filiptibell committed Feb 1, 2024
1 parent e759ec6 commit 53935bb
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
3 changes: 2 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ tracing-subscriber = { version = "0.3", features = ["env-filter"] }
tokio = { version = "1.24", features = ["full", "tracing"] }
os_str_bytes = { version = "6.4", features = ["conversions"] }

mlua-luau-runtime = { git = "https://github.com/lune-org/mlua-luau-runtime", rev = "f4ecf7e01845399b21a93d809b9c98e89d5a3bf5" }
mlua-luau-runtime = { git = "https://github.com/lune-org/mlua-luau-runtime", rev = "a5ae251fa3d62bb023dfbfc8ef692b28ff7a9a16" }
mlua = { version = "0.9.5", features = [
"async",
"luau",
Expand Down
7 changes: 4 additions & 3 deletions src/lune/globals/require/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -172,9 +172,10 @@ impl<'lua> RequireContext {
.into_lua_thread(lua)?;

// Schedule the thread to run, wait for it to finish running
let thread_handle = lua.push_thread_front(file_thread, ())?;
thread_handle.listen().await;
let thread_res = thread_handle.result(lua).unwrap();
let thread_id = lua.push_thread_front(file_thread, ())?;
lua.track_thread(thread_id);
lua.wait_for_thread(thread_id).await;
let thread_res = lua.get_thread_result(thread_id).unwrap();

// Return the result of the thread, storing any lua value(s) in the registry
match thread_res {
Expand Down
4 changes: 2 additions & 2 deletions src/lune/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,12 @@ impl Runtime {
eprintln!("{}", RuntimeError::from(e));
});

let handle = rt.push_thread_front(main, ())?;
let id = rt.push_thread_front(main, ())?;

rt.run().await;

// TODO: Grab exit code that user set, if available
let res = handle.result(&self.lua).unwrap();
let res = rt.get_thread_result(id).unwrap();
Ok(match res {
Ok(_) => ExitCode::SUCCESS,
Err(_) => ExitCode::FAILURE,
Expand Down

0 comments on commit 53935bb

Please sign in to comment.