IDE -- POST (Source) --> Broker
IDE -- GET (Highlighting) --> Broker
Broker -- GET (Highlighting) --> Highlighting Service
Highlighting Service -- GET (AST) --> Broker
Broker -- GET(AST) --> Parsing Service
Parsing Service -- Response(AST) --> Broker
Broker -- Response (AST) --> Highlighting Service
Highlighting Service -- Response (Highlighting) --> Broker
Broker -- Response (Highlighting) --> IDE.
For some services it is infeasible to be stateless, e.g. debuggers.
Addressed in the email, but I haven't thought of a good way (other than state tokens) to do this while still allowing multiple users per service.
I would not use JSON-Schema to describe the message formats. It is too verbose in my opinion. Can we use the format I used in the SLE'16 paper?
I chose JSON Schema because it's machine verifiable -- I can use the spec itself to validate network communications. (That's also why the schemas are all in their own files). If you want, I can use a more human-readable format in the actual document, though.
Why not send a GET request of the required products to the broker?
The broker needs a public IP in that case.
Here's what I'm envisioning, for the first request:
// For a file "foo"
Client -> Broker ClientRequest([Errors(foo)], [Source(foo)])
Broker -> ErrorService BrokerRequest([Errors(foo)], [Source(foo)])
Broker <- ErrorService [ Err(NeedsProducts([AST(foo)]))
, Info(DontNeedProducts([Source(foo)]))
]
Broker -> ASTService BrokerRequest([AST(foo)], [Source(foo)])
Broker <- ASTService Ok([AST(foo)])
Broker -> ErrorService BrokerRequest([Errors(foo)], [AST(foo)])
Broker <- ErrorService Ok([Errors(foo)])
Broker <- Client Ok([Errors(foo)])
The Broker could then cache the fact that for the file foo
, ErrorService needs AST(foo)
and not Source(foo)
, so further requests are:
// For a file "foo"
Client -> Broker ClientRequest([Errors(foo)], [Source(foo)])
Broker -> ASTService BrokerRequest([AST(foo)], [Source(foo)])
Broker <- ASTService Ok([AST(foo)])
Broker -> ErrorService BrokerRequest([Errors(foo)], [AST(foo)])
Broker <- ErrorService Ok([Errors(foo)])
Broker <- Client Ok([Errors(foo)])