Skip to main content

Generic query protocol

The Query protocol is defined here:

The Query protocol allows clients to send queries to a server. It is parameterized by the type of query that the server supports.

Protocol states

Protocol stateAgencyParameterDescription
1. ReqClientThe client is preparing a request to send.
2. Res aServerThe server handling a request from the client.
aThe type of the response.
3. DoneNobodyThe terminal state.

Query Protocol messages

MessageBegin stateEnd stateParameterDescription
1. Request reqReqRes aSends a request to the server.
ctxAn optional Open Telemetry span context originating from the sender from which child spans on the server should descend.
reqA request tree with a result of type a.
2. Respond aRes aReqSends a response to the client.
aThe response type.
3. DoneReqDoneTerminates the session.
ctxAn optional Open Telemetry span context originating from the sender from which child spans on the server should descend.

Request trees

The RequestTree structure allows multiple requests of a given request type to be sent in parallel, and combines the associated response types for those requests. For a request type req, the following request tree types are supported:

RequestParameterResultDescription
Leaf reqaA single request at the leaf of the tree with result type a.
reqA request with result type a.
Bin tree1 tree2(a, b)Two request sub-trees with a combined result type (a, b).
tree1A request tree with result type a.
tree2A request tree with result type b.