GoTomato/internal/websocket/vars.go
Sebastian Mark 92260b44db feat: introduce const for broadcast interval
- change ticker to use BROADCAST_INTERVAL constant
- define BROADCAST_INTERVAL as 1 second

🤖
2024-11-21 18:54:08 +01:00

19 lines
449 B
Go

package websocket
import (
"net"
"sync"
"git.smsvc.net/pomodoro/GoTomato/pkg/models"
)
const BROADCAST_INTERVAL = 1
const SEND_TIMEOUT = 10
const STALE_CLIENT_TIMEOUT = 90
const STALE_CHECK_INTERVALL = 30
// Clients is a map of connected WebSocket clients, where each client is represented by the WebsocketClient struct
var Clients = make(map[net.Addr]*models.WebsocketClient)
// Mutex to protect access to the Clients map
var mu sync.Mutex