docs: improve of websocket
continuous-integration/drone the build was successful Details

This commit is contained in:
Geno 2021-06-01 18:09:40 +02:00
parent de11bae835
commit a2bea2277b
1 changed files with 5 additions and 5 deletions

View File

@ -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
}