docs: improve of websocket
continuous-integration/drone the build was successful
Details
continuous-integration/drone the build was successful
Details
This commit is contained in:
parent
de11bae835
commit
a2bea2277b
|
@ -81,13 +81,13 @@ func NewEndpoint() *WebsocketEndpoint {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Broadcast Message to all subscriber (exclude sender of Message)
|
// Broadcast Message to all subscriber (exclude sender of Message)
|
||||||
func (this *WebsocketEndpoint) Broadcast(msg *Message) {
|
func (we *WebsocketEndpoint) Broadcast(msg *Message) {
|
||||||
this.subscribersMu.Lock()
|
we.subscribersMu.Lock()
|
||||||
defer this.subscribersMu.Unlock()
|
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 {
|
if s == msg.Subscriber {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue