summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--worker.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/worker.go b/worker.go
index c0ccc65..baf85ff 100644
--- a/worker.go
+++ b/worker.go
@@ -89,7 +89,17 @@ func (w *Worker) Start(argv []string, module map[string]any) error {
}
w.lua.SetGlobal("luna")
+ waitCh := make(chan bool)
+ w.lua.yield = func () {
+ <- waitCh
+ }
+ w.lua.resume = func () bool {
+ waitCh <- true
+ return true
+ }
+
err = w.lua.Require(argv[0])
+
if err != nil {
return err
}