This commit is contained in:
Ettore Di Giacinto
2024-04-08 00:35:14 +02:00
parent dbfc596333
commit 7adcce78be
8 changed files with 262 additions and 172 deletions

View File

@@ -7,7 +7,7 @@ import (
"sync"
"time"
"github.com/gofiber/fiber/v3"
"github.com/gofiber/fiber/v2"
"github.com/valyala/fasthttp"
)
@@ -26,7 +26,7 @@ type (
// Manager defines the interface for managing clients and broadcasting messages.
Manager interface {
Send(message Envelope)
Handle(ctx fiber.Ctx, cl Listener)
Handle(ctx *fiber.Ctx, cl Listener)
Clients() []string
}
@@ -111,7 +111,7 @@ func (manager *broadcastManager) Send(message Envelope) {
}
// Handle sets up a new client and handles the connection.
func (manager *broadcastManager) Handle(c fiber.Ctx, cl Listener) {
func (manager *broadcastManager) Handle(c *fiber.Ctx, cl Listener) {
manager.register(cl)
ctx := c.Context()