func (s *tagStore) reset() {
	if len(s.store) == 0 {
		return
	}

	events := make([]types.EntityEvent, 0, len(s.store))

	for _, e := range s.store {
		events = append(events, types.EntityEvent{
			EventType: types.EventTypeDeleted,
			Entity:    types.Entity{ID: e.ID},
		})
	}

	s.notifySubscribers(events)

	s.store = make(map[string]*types.Entity)
}
// reset clears the local store, preparing it to be re-initialized from a fresh
// stream coming from the remote source. It also notifies all subscribers that
// entities have been deleted before re-adding them. In practice, a remote
// tagger is not expected to have subscribers though.
// NOTE: caller must ensure that it holds s.mutex's lock, as this func does not
// do it on its own.
reset clears the local store, preparing it to be re-initialized from a fresh
stream coming from the remote source. It also notifies all subscribers that
entities have been deleted before re-adding them. In practice, a remote
tagger is not expected to have subscribers though.
NOTE: caller must ensure that it holds s.mutex's lock, as this func does not
do it on its own.
// reset clears the local store preparing it to be re - initialized from a fresh // stream coming from the remote source . It also notifies all subscribers that // entities have been deleted before re - adding them . In practice a remote // tagger is not expected to have subscribers though . // NOTE : caller must ensure that it holds s . mutex ' s lock as this func does not // do it on its own .
func (s *tagStore) reset() {
	if len(s.store) == 0 {
		return
	}
	events := make([]types.EntityEvent, 0, len(s.store))
	for _, e := range s.store {
		events = append(events, types.EntityEvent{
			EventType: types.EventTypeDeleted,
			Entity:    types.Entity{ID: e.ID},
		})
	}
	s.notifySubscribers(events)
	s.store = make(map[string]*types.Entity)
}
func ( s * tagStore ) reset ( ) { if len ( s . store ) == 0 { return } events := make ( [ ] types . EntityEvent , 0 , len ( s . store ) ) for _ , e := range s . store { events = append ( events , types . EntityEvent { EventType : types . EventTypeDeleted , Entity : types . Entity { ID : e . ID } , } ) } s . notifySubscribers ( events ) s . store = make ( map [ string ] * types . Entity ) }
reset clears the local store, preparing it to be re-initialized from a fresh
stream coming from the remote source.
reset clears the local store preparing it to be re - initialized from a fresh stream coming from the remote source .