Skip to content
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

Add Support for QWATCH Command with HTTP #553

Closed
pratikpandey21 opened this issue Sep 12, 2024 · 2 comments
Closed

Add Support for QWATCH Command with HTTP #553

pratikpandey21 opened this issue Sep 12, 2024 · 2 comments

Comments

@pratikpandey21
Copy link
Contributor

Description

Implement support for the QWATCH command over HTTP, utilizing Server-Sent Events (SSE) to enable real-time updates to clients based on changes to underlying data. This enhancement will allow HTTP clients to subscribe to SQL-like queries over data structures and receive push notifications whenever the results of the query change, providing a more efficient alternative to polling for updates.

Command Overview:

Command: QWATCH
HTTP Method: POST
Endpoint: /QWATCH
Body: SQL Query. Check here for Query reference.

Behaviour with HTTP:

Subscription Mechanism:

  • When an HTTP client sends a POST request to the /QWATCH endpoint with the query parameter, the server establishes a persistent connection using Server-Sent Events (SSE).
  • The server continuously monitors the data matching the specified query.
  • Whenever a data modification affects the query results, the server updates the client over the SSE connection.

Response Format:

The server responds with an HTTP 200 OK status and sets the Content-Type header to text/event-stream.
Each update is sent as an SSE event with the following format:

data: [{"key": "<key>", "value": <JSON value>}]

Tasks:

  • Implement the /QWATCH endpoint to accept HTTP POST requests.
  • Establish an SSE connection and manage it efficiently to support multiple concurrent clients.
  • Create comprehensive documentation for using QWATCH over HTTP, including examples.
@lucifercr07
Copy link
Contributor

@pratikpandey21 would like to work on this.

@lucifercr07
Copy link
Contributor

Closing, merged as part of #614

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants