manager/runner.go
func (r *Runner) Receive(d dep.Dependency, data interface{}) {
	r.dependenciesLock.Lock()
	defer r.dependenciesLock.Unlock()

	// Just because we received data, it does not mean that we are actually
	// watching for that data. How is that possible you may ask? Well, this
	// Runner's data channel is pooled, meaning it accepts multiple data views
	// before actually blocking. Whilest this runner is performing a Run() and
	// executing diffs, it may be possible that more data was pushed onto the
	// data channel pool for a dependency that we no longer care about.
	//
	// Accepting this dependency would introduce stale data into the brain, and
	// that is simply unacceptable. In fact, it is a fun little bug:
	//
	//     https://github.com/hashicorp/consul-template/issues/198
	//
	// and by "little" bug, I mean really big bug.
	if _, ok := r.dependencies[d.String()]; ok {
		log.Printf("[DEBUG] (runner) receiving dependency %s", d)
		r.brain.Remember(d, data)
	}
}
func (r *Runner) Receive(d dep.Dependency, data interface{}) {
	r.dependenciesLock.Lock()
	defer r.dependenciesLock.Unlock()

	// Just because we received data, it does not mean that we are actually
	// watching for that data. How is that possible you may ask? Well, this
	// Runner's data channel is pooled, meaning it accepts multiple data views
	// before actually blocking. Whilest this runner is performing a Run() and
	// executing diffs, it may be possible that more data was pushed onto the
	// data channel pool for a dependency that we no longer care about.
	//
	// Accepting this dependency would introduce stale data into the brain, and
	// that is simply unacceptable. In fact, it is a fun little bug:
	//
	//     https://github.com/hashicorp/consul-template/issues/198
	//
	// and by "little" bug, I mean really big bug.
	if _, ok := r.dependencies[d.String()]; ok {
		log.Printf("[DEBUG] (runner) receiving dependency %s", d)
		r.brain.Remember(d, data)
	}
}
func ( r * Runner ) Receive ( d dep . Dependency , data interface { } ) { r . dependenciesLock . Lock ( ) defer r . dependenciesLock . Unlock ( ) // Just because we received data, it does not mean that we are actually // watching for that data. How is that possible you may ask? Well, this // Runner's data channel is pooled, meaning it accepts multiple data views // before actually blocking. Whilest this runner is performing a Run() and // executing diffs, it may be possible that more data was pushed onto the // data channel pool for a dependency that we no longer care about. // // Accepting this dependency would introduce stale data into the brain, and // that is simply unacceptable. In fact, it is a fun little bug: // //     https://github.com/hashicorp/consul-template/issues/198 // // and by "little" bug, I mean really big bug. if _ , ok := r . dependencies [ d . String ( ) ] ; ok { log . Printf ( " " , d ) r . brain . Remember ( d , data ) } }
// Receive accepts a Dependency and data for that dep. This data is
// cached on the Runner. This data is then used to determine if a Template
// is "renderable" (i.e. all its Dependencies have been downloaded at least
// once).
Receive accepts a Dependency and data for that dep . This data is cached on the Runner . This data is then used to determine if a Template is renderable ( i . e . all its Dependencies have been downloaded at least once ) .