From a2bea2277b1eb7c3d30d73367f94c3f800e228fe Mon Sep 17 00:00:00 2001 From: Geno Date: Tue, 1 Jun 2021 18:09:40 +0200 Subject: [PATCH] docs: improve of websocket --- web/ws/main.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/web/ws/main.go b/web/ws/main.go index 3bc3ec2..0e7003e 100644 --- a/web/ws/main.go +++ b/web/ws/main.go @@ -81,13 +81,13 @@ func NewEndpoint() *WebsocketEndpoint { } // Broadcast Message to all subscriber (exclude sender of Message) -func (this *WebsocketEndpoint) Broadcast(msg *Message) { - this.subscribersMu.Lock() - defer this.subscribersMu.Unlock() +func (we *WebsocketEndpoint) Broadcast(msg *Message) { + we.subscribersMu.Lock() + defer we.subscribersMu.Unlock() - this.publishLimiter.Wait(context.Background()) + we.publishLimiter.Wait(context.Background()) - for s := range this.Subscribers { + for s := range we.Subscribers { if s == msg.Subscriber { continue }