You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First of all, good job with developing and publishing those sets of useful classes. They are a big time-saver and there are several very useful ones.
I was interested in the scheduled tasks and made a test, which worked nicely. However, I didn't see any way to wait for the tasks or to stop them. If it exists and I have missed it, sorry.
Here is what I mean: Let's say that there is a scheduled task, which has a long execution time and it starts. If I want to close the application, I will have to signal the task to end and to wait for it to do it gracefully.
It would be handy to have a set of methods like scheduledtasks.Terminate(and a flag that can be checked by the task) to signal any running task to interrupt, and a scheduledtasks.Wait to wait for any running one to finish.
Of course this can be achieved by doing the sync manually, but it will be useful to have it integrated.
Btw, some of your interface like ITask are named the same as the ones in System.Threading. These are the best names, but it creates an inconvenience when having a lot of code using the System ITask, and trying to integrate your classes gradually :)
I have to go over the code and add prefixes or reorder the units under uses...
The text was updated successfully, but these errors were encountered:
When you close your application, Scheduler destroy method calls terminate and waits for execute method exit. Execute method is a loop checking for time and launching every task when its schedule is reached . This means no new tasks will be launched, but current running taks should be finish gracefully after completed..
Well, yes, the scheduler will stop and no new tasks will be created, and the running ones will eventually finish.
What I meant is that if there is a task that takes 2 minutes, it has to be interrupted if the user decides to close the app. And also the other threads may have to know if the above task has finished, and wait for it, for example if there are shared resources that can be freed.
This of course can be done by events, or critical sections, etc.
It would be handy if those functions were built in your classes, similar to the usage of TTask.WaitForAll, and ITask.Cancel + ITask.Status/ITask.CheckCancelled.
Anyway, I was just sharing my suggestion for an easier usage.
First of all, good job with developing and publishing those sets of useful classes. They are a big time-saver and there are several very useful ones.
I was interested in the scheduled tasks and made a test, which worked nicely. However, I didn't see any way to wait for the tasks or to stop them. If it exists and I have missed it, sorry.
Here is what I mean: Let's say that there is a scheduled task, which has a long execution time and it starts. If I want to close the application, I will have to signal the task to end and to wait for it to do it gracefully.
It would be handy to have a set of methods like
scheduledtasks.Terminate
(and a flag that can be checked by the task) to signal any running task to interrupt, and ascheduledtasks.Wait
to wait for any running one to finish.Of course this can be achieved by doing the sync manually, but it will be useful to have it integrated.
Btw, some of your interface like ITask are named the same as the ones in System.Threading. These are the best names, but it creates an inconvenience when having a lot of code using the System ITask, and trying to integrate your classes gradually :)
I have to go over the code and add prefixes or reorder the units under
uses...
The text was updated successfully, but these errors were encountered: