Long term solution or alternative for System.Timer

0 Answers 2 Views
General Discussions
Jonathan
Top achievements
Rank 1
Iron
Jonathan asked on 02 Jan 2026, 03:21 PM

I followed the example provided here

Blazor Rebind Grid from Timer - Telerik UI for Blazor

And we have a working instance of this in our website.  However, the app is being used in an environment where a particular Telerik Chart and Grid are being left on for days at a time.  Now I believe the issue is actually with System.Timer.Timer and Blazor more than any Telerik control.

System.Timer.Timer will create a thread process on the Client server side.  This leads us into multi-threaded thread management and lifetimes and there are a number of things that may interfere. After a long period, per example more than 1 day, the timer stops working. And if the thread is working and the Blazor app does not properly call Dispose() then the thread could become orphaned.

Is there a better way to manage this with C# and Blazor?  Theoretically I could have 100 users with 100 different timers as provided in the example above. Optimistically, I need only 1 timer to exist on the server, and some sort of API that polls the 1 timer I have against 100 clients.  This means I am moving the timer from a C# System.Timer.Timer thread on the server towards a JavaScript based timer on the client, yes?

No answers yet. Maybe you can help?

Tags
General Discussions
Asked by
Jonathan
Top achievements
Rank 1
Iron
Share this question
or