[Braindump] Proposal for redesigning the client interface
I came out with this proposal after working on #606.
My problem with the Client interface is that, while Send and Request maps the interfaces in protocol, StartReceiver doesn't map the semantics of Receiver and Responder. This is particularly weird with websocket for example, when you have a bi-directional client per stream, so you can do something like:
c.Send()
[...]
c.Receive()
In particular, I find that StartReceiver is opinionated, maps to the concepts of http more than the concepts of messaging and it's less golang idiomatic than a channel or a method like Receive. Another point to consider is that going from the method invocation to the handler mode is relatively straightforward (and we could easily provide the method to do it, like showed in this PR), while going from the handler mode to the method invocation is harder and, generally, more error prone.
Signed-off-by: Francesco Guardiani [email protected]
Think about a v3?
Maybe, let's get the 2.4 out first :smile:
Would someone like to follow through on this one? If not we're probably going to close it.