I have a variable (custom object) in a singleton that I want to update based on a timer.
So, every 30 minutes I would get the new values from the database and update this variable. Eventual consistency between various servers is the only thing that's important - so if one server has a bit older value because the singleton timer is not synced that isn't an issue.
I was thinking of spawning off a thread in the singleton constructor with a timer and updating the variable based on that timer.
I'm not sure where in the application lifecycle a thread started from a singleton could be terminated. Is this the correct architectural approach to this? Or, is there something else I should be doing?