Sebastian Mark
9a86adaf85
- change ticker to use BROADCAST_INTERVAL constant
- define BROADCAST_INTERVAL as 1 second
🤖
19 lines
449 B
Go
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
|