J
J
jammywork12015-03-23 11:18:09
JavaScript
jammywork1, 2015-03-23 11:18:09

What could be dangerous about using System.Threading.Timer?

Deciding to add dynamism to the project, I thought about the implementation, read about SignalR. Implemented.
On the backend, at the request of the user, a number of actions are performed in a separate thread.
Process data is regularly sent to the user. The user's progress bar is updated.
I didn’t want to load the frontend once again, I really don’t like it when a strong load is given to the user, after all, how many javascript engines are eating CPU and Memory ...
The thread is started using the System.Threading.Timer class, with an interval of 10 seconds.
More precisely, I pass a procedure to the timer in which, depending on the state of the object, either the launch of long-term manipulations begins, or data is sent to the user via SignalR, or if the process is completed, the objects are deleted like the timer itself.
In principle, it seems to work quite normally, but I have bad feelings ...
I can write more details with code examples only in the evening.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question