Subscribing with a bit of history #3404
Unanswered
nielsbasjes
asked this question in
Q&A
Replies: 1 comment 1 reply
-
This is less a question on the graphql subscription and more a question for the backing implementation of events. For example does the "store" that has the events have this capability? If you are using Reactor say for the JVM api to get events are you using the methods that allow access to past events? |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm working on a homeautomation hobby project. I have events from a physical device (some kind of sensor; Solar converter, heatpump, electricity meter, ...) and I want to create an app (Flutter) that shows me a
realtime
indicator of the current value and a graph with the values for the last few hours (which is also updated on each newly arriving event).Because the physical device itself speaks modbus I want to create a GraphQL api over that to make it more practically usable.
For the graph in my app I need to have the latest value available and a bit of history (say few hours worth) to ensure the graph is filled when the user opens the app.
I now have
I'm sure I can get this working; yet I had this idea on how it may be easier to use:
Q: Is it possible to have
a new subscriber
receive a limited set ofold events
before they receive the current events in the stream?I want to have the subscriber optionally indicate how much history they want (either number of events or earliest timestamp field in the event record) and indicate the granularity of the events (like not all but only 1 per minute or an average per minute).
So only this specific new subscriber will get this history and only what this subscriber indicated they want.
Is this possible to combine this into the outgoing stream for this single specific subscriber?
Or is a separate subscription and a separate query the only way to do this?
Beta Was this translation helpful? Give feedback.
All reactions