Enha: sse update on actions

This commit is contained in:
Grail Finder
2025-05-10 11:03:23 +03:00
parent 416cc63ec0
commit 35e215e26f
12 changed files with 89 additions and 73 deletions

View File

@ -1,7 +1,6 @@
package handlers
import (
"fmt"
"golias/broker"
"golias/config"
"golias/pkg/cache"
@ -9,7 +8,6 @@ import (
"log/slog"
"net/http"
"os"
"time"
)
var (
@ -28,18 +26,6 @@ func init() {
cfg = config.LoadConfigOrDefault("")
Notifier = broker.NewBroker()
go Notifier.Listen()
ticker := time.NewTicker(2 * time.Second)
go func() {
counter := 0
for {
<-ticker.C
Notifier.Notifier <- broker.NotificationEvent{
EventName: "test",
Payload: fmt.Sprintf("%v test call of notifier", counter),
}
counter++
}
}()
}
var roundWords = map[string]string{