diff options
| author | unwox <me@unwox.com> | 2025-09-04 19:49:41 +0600 |
|---|---|---|
| committer | unwox <me@unwox.com> | 2025-09-04 19:49:41 +0600 |
| commit | 0cd409fe6671f045f4c7931506dc5fd42a5a400c (patch) | |
| tree | d04b8d617c5b0cab97fa62b1bfcc2d87ffd84434 /worker.go | |
| parent | 5e9fb54aaedcf5949e42c0d8e7a25093bdc6ac14 (diff) | |
fix coroutines on lua app init
Diffstat (limited to 'worker.go')
| -rw-r--r-- | worker.go | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -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 } |
