summaryrefslogtreecommitdiff
path: root/worker.go
diff options
context:
space:
mode:
authorunwox <me@unwox.com>2024-06-13 13:12:17 +0600
committerunwox <me@unwox.com>2024-06-13 13:12:17 +0600
commit4374d8c5d98fbc9e2589074cd0f05266db6a10e1 (patch)
treefd366c586cc6ba5c888c3c87b592f49ed9a34b9d /worker.go
parentc1ac633d9fa5da9fb312e4a990ee48d0fa7c0c4e (diff)
implement unsafe evaluation of lua code in workers
Diffstat (limited to 'worker.go')
-rw-r--r--worker.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/worker.go b/worker.go
index 6d659da..01b55e3 100644
--- a/worker.go
+++ b/worker.go
@@ -130,7 +130,11 @@ func (w *Worker) ListRoutes() []string {
return res
}
-func (w *Worker) Stop () {
+func (w *Worker) Eval(code string) error {
+ return w.lua.LoadString(code)
+}
+
+func (w *Worker) Stop() {
w.lua.Close()
}