~dave-cheney/pyjuju/go-watcher-channel

« back to all changes in this revision

Viewing changes to state/watcher.go

  • Committer: Dave Cheney
  • Date: 2012-05-09 20:05:45 UTC
  • Revision ID: david.cheney@canonical.com-20120509200545-ig6r8mpyvzfg25dg
extend the Changes channel pattern into watcher/watcher.go

Show diffs side-by-side

added added

removed removed

Lines of Context:
54
54
                select {
55
55
                case <-w.tomb.Dying():
56
56
                        return
57
 
                case change, ok := <-w.watcher.Changes():
 
57
                case change, ok := <-w.watcher.Changes:
58
58
                        if !ok {
59
59
                                return
60
60
                        }
123
123
                select {
124
124
                case <-w.tomb.Dying():
125
125
                        return
126
 
                case change, ok := <-w.watcher.Changes():
 
126
                case change, ok := <-w.watcher.Changes:
127
127
                        if !ok {
128
128
                                return
129
129
                        }
196
196
                select {
197
197
                case <-w.tomb.Dying():
198
198
                        return
199
 
                case change, ok := <-w.watcher.Changes():
 
199
                case change, ok := <-w.watcher.Changes:
200
200
                        if !ok {
201
201
                                return
202
202
                        }
265
265
                select {
266
266
                case <-w.tomb.Dying():
267
267
                        return
268
 
                case change, ok := <-w.watcher.Changes():
 
268
                case change, ok := <-w.watcher.Changes:
269
269
                        if !ok {
270
270
                                return
271
271
                        }
332
332
                select {
333
333
                case <-w.tomb.Dying():
334
334
                        return
335
 
                case change, ok := <-w.watcher.Changes():
 
335
                case change, ok := <-w.watcher.Changes:
336
336
                        if !ok {
337
337
                                return
338
338
                        }