summaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
authorunwox <me@unwox.com>2024-07-23 23:49:33 +0600
committerunwox <me@unwox.com>2024-07-23 23:54:12 +0600
commit7d1ab002530c2fe1f4c6a7cf67a16694e289b8ac (patch)
tree6e77c35fa97068abbabda7fe88c505245e83b173 /main.go
parentcba8ff3896a59598e9f0aa946fd547002ac23aba (diff)
add more comments
Diffstat (limited to 'main.go')
-rw-r--r--main.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/main.go b/main.go
index 8fb3608..5a876b9 100644
--- a/main.go
+++ b/main.go
@@ -10,9 +10,11 @@ import (
)
func main() {
+ // queue for http messages for workers to handle
msgs := make(chan interface{}, 4096)
mux := http.NewServeMux()
wrks := []*Worker{}
+ // track routes for mux to avoid registering the same route twice
routes := make(map[string]bool)
// define luna.router module
@@ -85,7 +87,7 @@ func main() {
for {
code, _ := reader.ReadString('\n')
for _, wrk := range wrks {
- if err := wrk.Run(code); err != nil {
+ if err := wrk.Eval(code); err != nil {
log.Printf("error: %s\n", err)
break
}