<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, May 6, 2013 at 5:20 PM, Dan Smith <span dir="ltr"><<a href="mailto:dms@danplanet.com" target="_blank">dms@danplanet.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">> I was just wondering about the magic rpc part.<br>
><br>
> It might be controversial but is a decorator the right way to go?<br>
<br>
</div>To summarize the discussion we just had on IRC: yes. The decorator<br>
provides us the simple per-method indirection needed to call out to the<br>
actual implementation via RPC if our service is marked as<br>
should-be-remote. Function decorators are for modifying or augmenting<br>
the behavior of a function call, which is what is being done here.<br></blockquote><div><br></div><div style> With the decorator approach, how do you handle the case where magic_method has to do something different based on the attributes of the object that has the method? Say for example, if different nova compute instances needed to have rpc messages go to different exchanges, topics, or servers?</div>
</div><br></div></div>