本文整理汇总了Golang中github.com/pdf/golifx/common.Subscription.ID方法的典型用法代码示例。如果您正苦于以下问题:Golang Subscription.ID方法的具体用法?Golang Subscription.ID怎么用?Golang Subscription.ID使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类github.com/pdf/golifx/common.Subscription
的用法示例。
在下文中一共展示了Subscription.ID方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: CloseSubscription
// 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
}
示例2: CloseSubscription
// 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
}
示例3: CloseSubscription
// 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
}
示例4: CloseSubscription
// 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
}