Include lb_tasklib::spawn in globals

This commit is contained in:
2025-06-26 17:52:31 +10:00
parent 0cafac0948
commit 24c5e9edc2
3 changed files with 9 additions and 2 deletions

6
crates/lb/src/task.lua Normal file
View File

@@ -0,0 +1,6 @@
local task = require("lb:task")
-- include `lb_tasklib::spawn` in the global scope
function spawn(f, ...)
return task:spawn(f, ...)
end

View File

@@ -7,6 +7,7 @@ use tokio::task::JoinHandle;
pub struct lb_tasklib;
#[metatype]
#[include("task.lua")]
impl lb_tasklib {
#[new]
extern "Lua-C" fn new() -> Self {