-
Notifications
You must be signed in to change notification settings - Fork 0
Tracker Protocol
The tracker protocol is really simple. It uses Websocket connections to reduce overhead. Connections have no state, except for HTTP Basic authentication to determine which pipeline the tracker is communicating with.
All commands must be atomic. Either they succeed, or they do not succeed. If something goes wrong, all persistent state must remain consistent. This allows for retries and makes the system more robust.
Requests currently have two fields—type and seq. type is the message type, and seq is a sequence number that the client generates to ensure messages don't get mixed up. Some requests will also require a third field, request, containing any additional parameters. The request field is a dictionary; keys must be strings.
Requests are sent from the client to the server.
Responses currently have three fields—status, payload, and seq. status is an HTTP status code corresponding to the result of the request. payload is the return value. seq is a copy of the seq value from the request.
In this article, when a response is described as having no payload, that should be interpreted as a payload of null. A server must provide a payload field even if it is null.
Responses are sent from the server to the client in response to requests.
Advisories are a special case. They are not directly triggered by a request; instead, the server may subscribe a client to certain advisories as a result of a request. Advisories have three fields—type, payload, and seq. seq is always None, to denote the message as an advisory.
No parameters.
Ensures the connection is still alive. The Websocket protocol does have its own ping mechanism at the protocol level, but some libraries do not fully expose it.
Elicits a response with a status code of 204 and no payload.
Request parameters:
-
pipeline: Pipeline type to dequeue from. (e.g. brozzler, zeno)
Claims an item corresponding to pipeline type pipeline.
Elicits a response with a status code of 200. If an item was found, it is contained in the item field of the payload. Otherwise, the item field of the payload is null.