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 graphql subscription as sink to measure service websocket #377

Closed
mxfactorial opened this issue Aug 27, 2024 · 2 comments · Fixed by #378
Closed

add graphql subscription as sink to measure service websocket #377

mxfactorial opened this issue Aug 27, 2024 · 2 comments · Fixed by #378
Assignees

Comments

@mxfactorial
Copy link
Contributor

mxfactorial commented Aug 27, 2024

expected

graphql publishes the websocket produced by the new measure service as a subscription

initial end to end feature:

  1. postgres sends equilibrium insert notification, e.g. pg_notify("2024-08-07:gdp:usa:cal", "10");
  2. event service listens for and receives equilibrium insert notification, then incrbys a redis gdp key, e.g. INCRBY 2024-08-27:gdp:usa:cal 10 which increments, for example, the california gdp value to 40
  3. redis publishes the gdp value changed by incrby on a channel named after the gdp key, e.g. PUBLISH 2024-08-27:gdp:usa:cal 40
  4. measure service subscribes to redis, then receives the changed gdp value and passes it to a websocket
  5. graphql subscribes to gdp values sent on the measure service websocket and sends it to the public through a subscription

alternatives:
current design avoids weighing down graphql with a redis dependency and keeps its concern of serving as a lightweight, public api separate, but events can avoid a double hop with a direct subscription by graphql to redis

hourly estimate

rust: 8
tests: 2 (shortened for poc)

total: 10

@mxfactorial
Copy link
Contributor Author

hours worked

requirement writing: 1

@mxfactorial
Copy link
Contributor Author

hours worked

13.25

2024-08-28 18 01 25

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

Successfully merging a pull request may close this issue.

1 participant