Left: | ||
Right: |
LEFT | RIGHT |
---|---|
1 package state | 1 package state |
2 | 2 |
3 import ( | 3 import ( |
4 "launchpad.net/goyaml" | 4 "launchpad.net/goyaml" |
5 "launchpad.net/juju-core/log" | 5 "launchpad.net/juju-core/log" |
6 "launchpad.net/juju-core/state/presence" | 6 "launchpad.net/juju-core/state/presence" |
7 "launchpad.net/juju-core/state/watcher" | 7 "launchpad.net/juju-core/state/watcher" |
8 "launchpad.net/tomb" | 8 "launchpad.net/tomb" |
9 ) | 9 ) |
10 | 10 |
(...skipping 414 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
425 case w.changeChan <- uc: | 425 case w.changeChan <- uc: |
426 } | 426 } |
427 return nil | 427 return nil |
428 } | 428 } |
429 | 429 |
430 func (w *MachineUnitsWatcher) done() { | 430 func (w *MachineUnitsWatcher) done() { |
431 close(w.changeChan) | 431 close(w.changeChan) |
432 } | 432 } |
433 | 433 |
434 // MachineWatcher observes changes to the settings of a machine. | 434 // MachineWatcher observes changes to the settings of a machine. |
435 // Currently, alterations to AgentVersion and ProposedAgentVersion | |
niemeyer
2012/07/30 15:52:59
Why is that specific to versioning? Are we not mon
rog
2012/07/30 16:48:49
There are other aspects of the machine that this d
| |
436 // will trigger a message on the Changes channel. | |
437 type MachineWatcher struct { | 435 type MachineWatcher struct { |
438 contentWatcher | 436 contentWatcher |
439 m *Machine | 437 m *Machine |
440 changeChan chan *Machine | 438 changeChan chan *Machine |
441 } | 439 } |
442 | 440 |
443 // newMachineWatcher creates and starts a watcher to watch information | 441 // newMachineWatcher creates and starts a watcher to watch information |
444 // about the machine. | 442 // about the machine. |
445 func newMachineWatcher(m *Machine) *MachineWatcher { | 443 func newMachineWatcher(m *Machine) *MachineWatcher { |
446 w := &MachineWatcher{ | 444 w := &MachineWatcher{ |
(...skipping 478 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
925 return | 923 return |
926 } | 924 } |
927 select { | 925 select { |
928 case <-t.Dying(): | 926 case <-t.Dying(): |
929 return | 927 return |
930 case w.updates <- unitSettingsChange{name, us}: | 928 case w.updates <- unitSettingsChange{name, us}: |
931 } | 929 } |
932 } | 930 } |
933 } | 931 } |
934 } | 932 } |
LEFT | RIGHT |