-
Notifications
You must be signed in to change notification settings - Fork 5
Proposal for Service Invocation #130
base: main
Are you sure you want to change the base?
Conversation
…without having to appeal to Forwards
The relevant part is in this commit here f3f0118 |
Thanks @sleipnir. I'll review it. I'm not sure yet if I understand all implications and how it would fit into the protocol, but I'm very much open for an interaction model where an SDK can be provided much simple than it is right now. |
The big question that this proposal aims to answer is. Today what the customer can do is:
Which is good for some use cases and not good enough for other use cases. What we need to add in addition to Forwards would be:
In other words, it gives us the ability to call other services without interrupting the flow of the original service. Could I explain to you how things fit together? |
ef6b3bb
to
6a9e102
Compare
My proposal breaks a little bit of the initial premise of the CS protocol where the proxy acts as a client and the user function acts as a server, despite the communication being bidirectional originally, in fact the proxy starts and the user function responds with some information.
But I thought it would be difficult to reuse the original streamed semantics for a simple service invocation without having to force the sdks to implement it with callbacks or some kind of message buffer, which would make the whole flow very complex. So I chose to simplify and make the proxy also provide a service that could be called by the user function (again reversing the traditional flow) and would only play the function of orchestrator of the user function request.
Obviously this forces sdks to implement both a grpc server and a grpc client to communicate with the proxy. But that was a choice that Dapr followed and opened up so many paths for them. If there was an option to just keep streamed without it complicating things too much I'd take it, but I've thought a lot about the implications of streamed for things like invoking services and haven't been able to visualize how it could work without changing the structure of what was done.