func (cm *PubSub) Len(id string) int {
	if id == "" {
		return 0
	}
	cm.lock.Lock()
	defer cm.lock.Unlock()

	subscribers, ok := cm.subMap[id]
	if !ok {
		return 0
	}

	return len(subscribers)
}
// Len - returns the number of subscribers for a given id
returns the number of subscribers for a given id
// Len - returns the number of subscribers for a given id
func (cm *PubSub) Len(id string) int {
	if id == "" {
		return 0
	}
	cm.lock.Lock()
	defer cm.lock.Unlock()
	subscribers, ok := cm.subMap[id]
	if !ok {
		return 0
	}
	return len(subscribers)
}
func ( cm * PubSub ) Len ( id string ) int { if id == " " { return 0 } cm . lock . Lock ( ) defer cm . lock . Unlock ( ) subscribers , ok := cm . subMap [ id ] if ! ok { return 0 } return len ( subscribers ) }
returns the number of subscribers for a given id
returns the number of subscribers for a given id