Closed dghubble closed 7 years ago
Pass in a top-level stop channel to the agent operator to use when it launches goroutines or calls time.Sleep. In theory, if we trapped on signals in cmd, we'd see every goroutine stop and a clean "Stopping agent" log line.
time.Sleep
A general controller:
New(config Config) (*Kontroller) func (k *Kontroller) Run(stop <-chan struct{}) { // starting wait.Until(processLoop, period, stop) // stopping } func (k.Kontroller) process() { // reconciliation logic }
Similar to #108
Lemme add @euank's suggestion. Its non-essential as noted in the Twitter repo, but slightly nicer.
Pass in a top-level stop channel to the agent operator to use when it launches goroutines or calls
time.Sleep
. In theory, if we trapped on signals in cmd, we'd see every goroutine stop and a clean "Stopping agent" log line.A general controller:
Similar to #108