-
Notifications
You must be signed in to change notification settings - Fork 9
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
ms2/mqtt in memory storage #429
Conversation
This comment has been minimized.
This comment has been minimized.
✅ Successfully created Preview Deployment. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good I think. I don't have a better idea to handle this.
|
||
if (staleAfter) { | ||
clearTimeout(collectedData!.clearInterval); | ||
collectedData!.clearInterval = setTimeout(() => clearCollectedData(topic), staleAfter); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the name clearInterval
correct if it is not actually a recurring occurrence
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeahp, you're right, that was an old name I forgot to change.
I'll rename it in an upcoming PR.
Summary
The basic idea is to maintain a subscription to an MQTT topic and keep collecting data from it.
I implemented a basic structure to do this, any suggestions are welcome.
For now some of the values are hardcoded, but I intend to change that in the future.