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

Issue 98090043: rpc: expose concrete types

Can't Edit
Can't Publish+Mail
Start Review
Created:
9 years, 12 months ago by jameinel
Modified:
9 years, 12 months ago
Reviewers:
mp+218764, fwereade
Visibility:
Public.

Description

rpc: expose concrete types This changes the RPC package a bit so that if you are declaring RootMethod that returns 'interface{}' it can find the concrete type that is being returned and expose the methods on that type (instead of exposing 0 methods from interface{}). This is a step along the way to supporting passing versions for Facades in the "id" slot. We currently let you pass the value, but the concrete type that is returned defines all of the Methods that could be available. Which means that if you add a new Method in V2 of your API, you would suddenly have that exposed in the V1 of your API. Similarly you couldn't *actually* ever change the interface for a give method, because then you couldn't call it one way for V1 and a different way for V2. There is a fair bit more to be done before we have actual API versioning, but this is a step along that path and it seemed cohesive enough to review on its own. https://code.launchpad.net/~jameinel/juju-core/reflect-only-facades/+merge/218764 (do not edit description out of merge proposal)

Patch Set 1 #

Total comments: 3
Unified diffs Side-by-side diffs Delta from patch set Stats (+290 lines, -61 lines) Patch
A [revision details] View 1 chunk +2 lines, -0 lines 0 comments Download
M rpc/reflect_test.go View 4 chunks +36 lines, -20 lines 1 comment Download
M rpc/rpc_test.go View 9 chunks +208 lines, -19 lines 1 comment Download
M rpc/rpcreflect/type.go View 2 chunks +13 lines, -6 lines 1 comment Download
M rpc/rpcreflect/value.go View 5 chunks +25 lines, -12 lines 0 comments Download
M rpc/server.go View 3 chunks +6 lines, -4 lines 0 comments Download

Messages

Total messages: 2
jameinel
Please take a look.
9 years, 12 months ago (2014-05-08 09:35:27 UTC) #1
fwereade
9 years, 12 months ago (2014-05-08 11:50:56 UTC) #2
LGTM, thanks

https://codereview.appspot.com/98090043/diff/1/rpc/reflect_test.go
File rpc/reflect_test.go (right):

https://codereview.appspot.com/98090043/diff/1/rpc/reflect_test.go#newcode62
rpc/reflect_test.go:62: // Is this worth specifying?
It's a bit of a mouthful, but I think so.

https://codereview.appspot.com/98090043/diff/1/rpc/rpc_test.go
File rpc/rpc_test.go (right):

https://codereview.appspot.com/98090043/diff/1/rpc/rpc_test.go#newcode378
rpc/rpc_test.go:378: // to "a99" since that is what most of the SimpleMethods
code expects
<gentle twitch>

I've made this choice often enough myself, but rarely felt wholly comfortable
with it in retrospect. It's probably OK, I guess :).

https://codereview.appspot.com/98090043/diff/1/rpc/rpcreflect/type.go
File rpc/rpcreflect/type.go (right):

https://codereview.appspot.com/98090043/diff/1/rpc/rpcreflect/type.go#newcode161
rpc/rpcreflect/type.go:161: // that only embeds the interface you want.)
That does indeed work for me, but you don't have to do it here if it complicates
this CL.
Sign in to reply to this message.

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