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

Question - Is there any way to trigger an action when some items are expired? #167

Open
iliesh opened this issue May 31, 2022 · 0 comments

Comments

@iliesh
Copy link

iliesh commented May 31, 2022

I have the following scenario if you could help me to find the best approach by using this library - that will be great.

I have a server - which is monitoring some devices and sends this data to my application, now I have to update the main DB only when the status of the device has been changed. For example, let's say I have a device - dev1 which is offline at the moment (status 0), then when it came online server will send a notification to the app that dev1 became online and my application will update the main DB status - from 0 to 1, everything seems to be straight forward. The problem here is that the server is not sending any notification when the device is offline, so in case dev1 is already online and then for some reason it's going offline - then my application wouldn't know about that and will keep the status online in the main DB even if that dev is long time offline.

My thought here was to keep on the map only online devices with some expiration time, and in case some devices expired - that will mean that it's offline, and update the main DB accordingly.

Please let me know if it's possible to do that by using this library.

Thank you.

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

No branches or pull requests

1 participant