|
func (c *Client) handleServerSub(channel string, sub *protocol.Subscribe) error { |
|
c.mu.Lock() |
|
_, ok := c.serverSubs[channel] |
|
if ok { |
|
return nil |
|
} |
|
c.serverSubs[channel] = &serverSub{ |
|
Offset: sub.Offset, |
|
Epoch: sub.Epoch, |
|
Recoverable: sub.Recoverable, |
|
} |
|
c.mu.Unlock() |
|
if !ok { |
|
return nil |
|
} |
In the line 682-684, if this a new server side subscribe event, then handleServerSub
just returns, without calling custom OnServerSubscribe
handler.