-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Network transport specification draft #6219
Comments
Nice specification, Dmytro!
|
Absolutely right! Actually it is described in the original document in the part that is not mentioned in this issue. I agree that it is important thing that should be clarified here in the description so I will fix that ASAP. |
Issues go stale after Mark the issue as fresh with If this issue is safe to close now please do so. Moderators: Add |
Hi,
Currently in Che there is a couple of solutions to pass data over network between client (IDE, UD, etc) and server (workspace-agent, exec-agent, workspace-master) or between servers (workspace-agent to workspace-master, etc.). And the problem here is that there is no definition of how and when to use one or another approach. Right now there are no clear instructions on when we should use REST or JsonRPC, how requests should be generated and responses should be treated. It may be difficult for a developer to understand why in some component we use Json RPC while in another - REST, while obviously it should be as transparent as possible.
So here I will try to make some kind of a specification draft for the most common cases of data transmission and remote procedures executions that we practice in Che. Now follows the excerpt from the original document.
Motivation:
To be able to transparently use existed REST APIs for async requests (requests with potentially long response or response with big output, like logs). So it will work as normal REST calls for one services and “hybrid” way (REST + JSON RPC) for others.
Network data transmissions are specified by a couple of factors:
We use REST protocol for synchronous requests and Json RPC for asynchronous. It is important to mention that in general there is no limitation to use Json RPC for synchronous requests as well but it is encouraged not to do that to have more clear picture: if we’re running REST - it is always synchronous, while Json RPC - is always asynchronous. It is encouraged but not strictly required, there obviously may be exceptions based on real life use-case requirements (e.g. LSP requires Json RPC).
For some cases there is a need in multiple responses that may come within arbitrary periods of time (e.g. for project import we need to initialize a procedure but also to track it’s progress), so here we use a tricky combination: there is an initialization request, acceptance response and responses containing business data. The initialization request and acceptance response may be of REST or Json RPC protocol, while multiple over time responses are always Json RPC request/notification (mostly notifications) because of obvious limitations of REST/HTTP stack. To make it more clear let us take a closer look at a workflow for such cases:
So eventually we have a combination of four workflows:
Last thing I would like to emphasize is that this is not something new from technical perspective, we're already using REST and Json RPC in some similar way however we can't say we have a solid well specified and generalized network data transmission workflow.
The text was updated successfully, but these errors were encountered: