// CloseSubscription is a callback for handling the closing of subscriptions. func (p *V2) CloseSubscription(sub *common.Subscription) error { p.RLock() _, ok := p.subscriptions[sub.ID()] p.RUnlock() if !ok { return common.ErrNotFound } p.Lock() delete(p.subscriptions, sub.ID()) p.Unlock() return nil }
// CloseSubscription is a callback for handling the closing of subscriptions. func (d *Device) CloseSubscription(sub *common.Subscription) error { d.RLock() _, ok := d.subscriptions[sub.ID()] d.RUnlock() if !ok { return common.ErrNotFound } d.Lock() delete(d.subscriptions, sub.ID()) d.Unlock() return nil }
// CloseSubscription is a callback for handling the closing of subscriptions. func (c *Client) CloseSubscription(sub *common.Subscription) error { c.RLock() _, ok := c.subscriptions[sub.ID()] c.RUnlock() if !ok { return common.ErrNotFound } c.Lock() delete(c.subscriptions, sub.ID()) c.Unlock() return nil }
// CloseSubscription is a callback for handling the closing of subscriptions. func (g *Group) CloseSubscription(sub *common.Subscription) error { g.RLock() _, ok := g.subscriptions[sub.ID()] g.RUnlock() if !ok { return common.ErrNotFound } g.Lock() delete(g.subscriptions, sub.ID()) g.Unlock() return nil }