code: func (keys *watchBrokerKeys) resync() error {
  	iterators := map[string]datasync.KeyValIterator{}
  	for _, keyPrefix := range keys.prefixes {
  		it, err := keys.adapter.db.ListValues(keyPrefix)
  		if err != nil {
  			return errors.WithMessagef(err, "list values for %s failed", keyPrefix)
  		}
  		iterators[keyPrefix] = NewIterator(it)
  	}
  
  	resyncEvent := syncbase.NewResyncEventDB(context.Background(), iterators)
  
  	select {
  	case keys.resyncChan <- resyncEvent:
  		// ok
  	case <-time.After(ResyncAcceptTimeout):
  		logrus.DefaultLogger().Warn("Timeout of resync send!")
  		return errors.New("resync not accepted in time")
  	}
  
  	select {
  	case err := <-resyncEvent.DoneChan:
  		if err != nil {
  			return errors.WithMessagef(err, "resync returned error")
  		}
  	case <-time.After(ResyncDoneTimeout):
  		logrus.DefaultLogger().Warn("Timeout of resync callback!")
  	}
  
  	return nil
  }
docs: // Resync fills the resyncChan with the most recent snapshot (db.ListValues).