// Subscribe subscribes for data changes
Subscribe subscribes for data changes
// Subscribe subscribes for data changes
func (adapter *BaseAdapter) Subscribe(pathList []string) (err error) {
	adapter.Lock()
	defer adapter.Unlock()
	for _, path := range pathList {
		if _, ok := adapter.Data[path]; !ok {
			return fmt.Errorf("path %s doesn't exits", path)
		}
		adapter.Data[path].subscribe = true
	}
	return nil
}
func ( adapter * BaseAdapter ) Subscribe ( pathList [ ] string ) ( err error ) { adapter . Lock ( ) defer adapter . Unlock ( ) for _ , path := range pathList { if _ , ok := adapter . Data [ path ] ; ! ok { return fmt . Errorf ( " " , path ) } adapter . Data [ path ] . subscribe = true } return nil }
Subscribe subscribes for data changes
Subscribe subscribes for data changes