On Sep 30, 2013, at 12:09 PM, Laurens Van Houtven <_@lvh.io> wrote:
Hi Glyph,
Thanks for your response!
For someone confused about why it would help, you are pretty close to the mark :).
I am not trying to propose a specific new implementation mechanism, but rather to say that fromBox/toBox are broken, in that the contract of the 'proto' argument is incompletely specified. Most of the code I can think of that wants to use that really wants the transport rather than the "protocol", but nothing within AMP itself actually uses those arguments; in fact, searching the usual suspects (epsilon, vertex) I can't even find any Arguments that use the 'proto' argument for anything useful.
If I recall, I believe the idea behind it was to allow an AMP responder within Vertex to return the peer's IP address back to the peer, from within an authenticated AMP route that (because it was a route) wasn't necessarily connected directly to the transport (and therefore couldn't just do self.transport.getPeer()). Ironically I don't think it'll actually work for that now :-).
So in order to fix fromBox/toBox, we need to do a fix that firms up that contract and perhaps exposes more than a Protocol object. The *recommended* API should be more or less like what ExposingArgument is doing - specify an Argument that asks for a particular attribute of the transport or the protocol or the authentication context or whatever, the implementation details may involve other lower-level public APIs.
That would be cool. And, you know, that auth thing I said :-).
Living in that particular locale is going to spoil me. I feel like I may need to move somewhere more remote so that I am forced to have nice transparent discussions on the record like this one, on mailing lists on IRC :-).