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

Issue 13559043: api: Implement RelationUnitsWatcher in client API (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
10 years, 8 months ago by dimitern
Modified:
10 years, 8 months ago
Reviewers:
mp+184044, fwereade
Visibility:
Public.

Description

api: Implement RelationUnitsWatcher in client API This completes the implementation of UniterAPI WatchRelationUnits() at the client-side API by implementing the rest of the RelationUnitsWatcher. I missed some server-side code neede, which is added now. Also, as a consequence some of the relation and relation unit client methods got implemented, as well as client uniter tests were extended to cover the upcoming relation units tests. https://code.launchpad.net/~dimitern/juju-core/120-api-relationunitswatcher-client/+merge/184044 (do not edit description out of merge proposal)

Patch Set 1 #

Total comments: 8

Patch Set 2 : api: Implement RelationUnitsWatcher in client API #

Unified diffs Side-by-side diffs Delta from patch set Stats (+334 lines, -81 lines) Patch
A [revision details] View 1 1 chunk +2 lines, -0 lines 0 comments Download
M state/api/apiclient.go View 1 chunk +3 lines, -0 lines 0 comments Download
M state/api/state.go View 2 chunks +6 lines, -2 lines 0 comments Download
M state/api/uniter/relation.go View 3 chunks +11 lines, -6 lines 0 comments Download
M state/api/uniter/relationunit.go View 1 2 chunks +30 lines, -6 lines 0 comments Download
M state/api/uniter/unit.go View 1 chunk +1 line, -1 line 0 comments Download
M state/api/uniter/uniter.go View 4 chunks +47 lines, -14 lines 0 comments Download
M state/api/uniter/uniter_test.go View 20 chunks +113 lines, -51 lines 0 comments Download
M state/api/watcher/interfaces.go View 2 chunks +12 lines, -0 lines 0 comments Download
M state/api/watcher/watcher.go View 1 chunk +59 lines, -0 lines 0 comments Download
M state/apiserver/root.go View 1 chunk +18 lines, -0 lines 0 comments Download
M state/apiserver/uniter/uniter_test.go View 1 chunk +2 lines, -1 line 0 comments Download
M state/apiserver/watcher.go View 1 chunk +30 lines, -0 lines 0 comments Download

Messages

Total messages: 3
dimitern
Please take a look.
10 years, 8 months ago (2013-09-05 09:20:31 UTC) #1
fwereade
LGTM, thanks. https://codereview.appspot.com/13559043/diff/1/state/api/uniter/relationunit.go File state/api/uniter/relationunit.go (right): https://codereview.appspot.com/13559043/diff/1/state/api/uniter/relationunit.go#newcode118 state/api/uniter/relationunit.go:118: // Watch returns a watcher that notifies ...
10 years, 8 months ago (2013-09-05 13:06:06 UTC) #2
dimitern
10 years, 8 months ago (2013-09-05 13:19:33 UTC) #3
Please take a look.

https://codereview.appspot.com/13559043/diff/1/state/api/uniter/relationunit.go
File state/api/uniter/relationunit.go (right):

https://codereview.appspot.com/13559043/diff/1/state/api/uniter/relationunit....
state/api/uniter/relationunit.go:118: // Watch returns a watcher that notifies
of changes to conterpart
On 2013/09/05 13:06:07, fwereade wrote:
> s/conterpart/counterpart/

Done.

https://codereview.appspot.com/13559043/diff/1/state/api/uniter/uniter.go
File state/api/uniter/uniter.go (right):

https://codereview.appspot.com/13559043/diff/1/state/api/uniter/uniter.go#new...
state/api/uniter/uniter.go:108: result, err := st.relation(tag, st.unitTag)
On 2013/09/05 13:06:07, fwereade wrote:
> This bit still feels a bit funny, but I'm ok with it really. We'll figure out
> the right way eventually, and I don't think churn will help.

Yeah, I'm sure there'll be a few changes until we have the finished API.

https://codereview.appspot.com/13559043/diff/1/state/api/uniter/uniter_test.go
File state/api/uniter/uniter_test.go (right):

https://codereview.appspot.com/13559043/diff/1/state/api/uniter/uniter_test.g...
state/api/uniter/uniter_test.go:41: mysqlUnit        *state.Unit
On 2013/09/05 13:06:07, fwereade wrote:
> I think this is getting a bit big, maybe. I'd respond positively to a followup
> that split out a few separate test suites.

Yeah, will do.

https://codereview.appspot.com/13559043/diff/1/state/api/watcher/watcher.go
File state/api/watcher/watcher.go (right):

https://codereview.appspot.com/13559043/diff/1/state/api/watcher/watcher.go#n...
state/api/watcher/watcher.go:267: data, ok := <-w.in
On 2013/09/05 13:06:07, fwereade wrote:
> commonWatcher closes w.in when dying, I guess? Nice.

That's the way other watchers work and it seems fine to me so far.
Sign in to reply to this message.

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