Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(99)

Issue 6503086: mstate/watcher: new foundation for watchers

Can't Edit
Can't Publish+Mail
Start Review
Created:
13 years, 5 months ago by niemeyer
Modified:
13 years, 5 months ago
Reviewers:
aram, mp+123214, rog
Visibility:
Public.

Description

mstate/watcher: new foundation for watchers https://code.launchpad.net/~niemeyer/juju-core/mstate-watcher-foundation/+merge/123214 (do not edit description out of merge proposal)

Patch Set 1 #

Total comments: 14

Patch Set 2 : mstate/watcher: new foundation for watchers #

Total comments: 32

Patch Set 3 : mstate/watcher: new foundation for watchers #

Total comments: 4

Patch Set 4 : mstate/watcher: new foundation for watchers #

Total comments: 9

Patch Set 5 : mstate/watcher: new foundation for watchers #

Unified diffs Side-by-side diffs Delta from patch set Stats (+970 lines, -0 lines) Patch
A [revision details] View 1 2 3 4 1 chunk +2 lines, -0 lines 0 comments Download
A mstate/watcher/export_test.go View 1 1 chunk +15 lines, -0 lines 0 comments Download
A mstate/watcher/watcher.go View 1 2 3 4 1 chunk +386 lines, -0 lines 0 comments Download
A mstate/watcher/watcher_test.go View 1 2 3 1 chunk +567 lines, -0 lines 0 comments Download

Messages

Total messages: 12
niemeyer
Please take a look.
13 years, 5 months ago (2012-09-07 05:59:56 UTC) #1
rog
looks ok, but substantial caveat below. https://codereview.appspot.com/6503086/diff/1/mstate/watcher/watcher.go File mstate/watcher/watcher.go (right): https://codereview.appspot.com/6503086/diff/1/mstate/watcher/watcher.go#newcode36 mstate/watcher/watcher.go:36: // the the ...
13 years, 5 months ago (2012-09-07 08:45:37 UTC) #2
niemeyer
Please take a look. https://codereview.appspot.com/6503086/diff/1/mstate/watcher/watcher.go File mstate/watcher/watcher.go (right): https://codereview.appspot.com/6503086/diff/1/mstate/watcher/watcher.go#newcode36 mstate/watcher/watcher.go:36: // the the gorotuine loop. ...
13 years, 5 months ago (2012-09-07 14:18:16 UTC) #3
aram
AFAICS there is no way to watch over a whole collection, only over a set ...
13 years, 5 months ago (2012-09-08 17:50:03 UTC) #4
niemeyer
Please take a look. https://codereview.appspot.com/6503086/diff/1/mstate/watcher/watcher.go File mstate/watcher/watcher.go (right): https://codereview.appspot.com/6503086/diff/1/mstate/watcher/watcher.go#newcode119 mstate/watcher/watcher.go:119: // document, or -1 if ...
13 years, 5 months ago (2012-09-09 02:57:50 UTC) #5
aram
Thanks for looking into this, but I neither wanted or expected you to fix this ...
13 years, 5 months ago (2012-09-10 12:47:13 UTC) #6
niemeyer
https://codereview.appspot.com/6503086/diff/7002/mstate/watcher/watcher.go File mstate/watcher/watcher.go (right): https://codereview.appspot.com/6503086/diff/7002/mstate/watcher/watcher.go#newcode168 mstate/watcher/watcher.go:168: func (w *Watcher) Sync() { On 2012/09/10 12:47:13, aram ...
13 years, 5 months ago (2012-09-10 12:58:53 UTC) #7
aram
https://codereview.appspot.com/6503086/diff/7002/mstate/watcher/watcher.go File mstate/watcher/watcher.go (right): https://codereview.appspot.com/6503086/diff/7002/mstate/watcher/watcher.go#newcode168 mstate/watcher/watcher.go:168: func (w *Watcher) Sync() { > Testing is its ...
13 years, 5 months ago (2012-09-10 13:02:30 UTC) #8
niemeyer
Please take a look. https://codereview.appspot.com/6503086/diff/7002/mstate/watcher/watcher.go File mstate/watcher/watcher.go (right): https://codereview.appspot.com/6503086/diff/7002/mstate/watcher/watcher.go#newcode168 mstate/watcher/watcher.go:168: func (w *Watcher) Sync() { ...
13 years, 5 months ago (2012-09-10 13:04:38 UTC) #9
aram
LGTM
13 years, 5 months ago (2012-09-10 13:15:54 UTC) #10
rog
LGTM with a couple of final comments. I've been thinking about this a lot over ...
13 years, 5 months ago (2012-09-10 14:02:46 UTC) #11
niemeyer
13 years, 5 months ago (2012-09-10 15:50:51 UTC) #12
*** Submitted:

mstate/watcher: new foundation for watchers

R=rog, aram
CC=
https://codereview.appspot.com/6503086

https://codereview.appspot.com/6503086/diff/2002/mstate/watcher/watcher.go
File mstate/watcher/watcher.go (right):

https://codereview.appspot.com/6503086/diff/2002/mstate/watcher/watcher.go#ne...
mstate/watcher/watcher.go:117: // parameter informs the currently known revision
number for the document.
On 2012/09/10 14:02:46, rog wrote:
> s/informs/holds/

Done.

https://codereview.appspot.com/6503086/diff/2002/mstate/watcher/watcher.go#ne...
mstate/watcher/watcher.go:118: // Non-existing documents are represented by a -1
revno.
On 2012/09/10 14:02:46, rog wrote:
> s/Non-existing/Non-existing/
> or "Documents that do not exist are..."

Done.

https://codereview.appspot.com/6503086/diff/2002/mstate/watcher/watcher.go#ne...
mstate/watcher/watcher.go:123: select {
On 2012/09/10 14:02:46, rog wrote:
> how about:
> 
> func (w *Watcher) sendReq(req interface{}) {
>     select {
>     case w.request <- req:
>     case <-w.tomb.Dying():
>     }
> }
> 
> then all those select statements below become simple
> function calls.

Very nice. Cheers!

https://codereview.appspot.com/6503086/diff/2002/mstate/watcher/watcher.go#ne...
mstate/watcher/watcher.go:321: iter :=
w.log.Find(nil).Batch(10).Sort("-$natural").Iter()
On 2012/09/10 14:02:46, rog wrote:
> i think a comment on this rather involved line might be good.
> // Iterate backwards in time through all events in the log.
> ?

Good idea. Added a note.

https://codereview.appspot.com/6503086/diff/2002/mstate/watcher/watcher.go#ne...
mstate/watcher/watcher.go:321: iter :=
w.log.Find(nil).Batch(10).Sort("-$natural").Iter()
On 2012/09/10 14:02:46, rog wrote:
> i think a comment on this rather involved line might be good.
> // Iterate backwards in time through all events in the log.
> ?

Good idea. Added a note.
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b