Code review comment for lp:~themue/juju-core/024-cleanup-watcher

Revision history for this message
Frank Mueller (themue) wrote :

*** Submitted:

state: added CleanupWatcher

The CleanupWatcher signals the demand for the running of
state.Cleanup(). It is the first in a row of CLs to add
an according worker.

R=fwereade, dimitern
CC=
https://codereview.appspot.com/10078043

https://codereview.appspot.com/10078043/diff/14002/state/state_test.go
File state/state_test.go (right):

https://codereview.appspot.com/10078043/diff/14002/state/state_test.go#newcode1363
state/state_test.go:1363: c.Fatalf("unexpected change: %v", ok)
On 2013/06/07 12:24:50, dimitern wrote:
> please change this to say "unexpected change; ok: %v"

Done.

https://codereview.appspot.com/10078043/diff/14002/state/state_test.go#newcode1383
state/state_test.go:1383: // Add relations doesn't emit events.
On 2013/06/07 12:24:50, dimitern wrote:
> // Adding relations doesn't emit events.

Done.

https://codereview.appspot.com/10078043/diff/14002/state/state_test.go#newcode1415
state/state_test.go:1415: // A cleanup without need doesn't emit events.
On 2013/06/07 12:24:50, dimitern wrote:
> // Verify that Cleanup() doesn't emit unnecessary events.

Done.

https://codereview.appspot.com/10078043/diff/14002/state/state_test.go#newcode1420
state/state_test.go:1420: // Don't handle each event keeps them in the
queue. Cleanups
On 2013/06/07 12:24:50, dimitern wrote:
> // Not calling Cleanup() queues up the changes, so that
> // multiple changes will be emitted the next time Cleanup()
> // is called. This behavior will change in a follow-up.

That's not correct, the second part is related to the internal behavior
of Cleanup() with individual transactions per deletion. Will separate
this better.

https://codereview.appspot.com/10078043/diff/14002/state/watcher.go
File state/watcher.go (right):

https://codereview.appspot.com/10078043/diff/14002/state/watcher.go#newcode1251
state/watcher.go:1251: // CleanupWatcher notifies changes of the cleanup
documents
On 2013/06/07 12:24:50, dimitern wrote:
> // CleanupWatcher notifies of changes in the cleanups collection.
> ?

Done.

https://codereview.appspot.com/10078043/diff/14002/state/watcher.go#newcode1258
state/watcher.go:1258: // WatchCleanups returns a CleanupWatcher that
notifies when documents
On 2013/06/07 12:24:50, dimitern wrote:
> // WatchCleanups starts and returns a CleanupWatcher.

Done.

https://codereview.appspot.com/10078043/

« Back to merge proposal