Do not use a Thread to Periodically check for Due workers.

Each Periodic Worker has it's own Thread that waits for execution.
This commit is contained in:
2025-07-21 13:45:39 +02:00
parent 9d560692dc
commit dcf8ada486
4 changed files with 76 additions and 128 deletions

View File

@@ -68,7 +68,7 @@ public abstract class BaseWorker : Identifiable
/// <item>If <see cref="BaseWorker"/> has run, additional <see cref="BaseWorker"/>.</item>
/// </list>
/// </returns>
public Task<BaseWorker[]> DoWork()
public Task<BaseWorker[]> DoWork(Action? callback = null)
{
Log.Debug($"Checking {this}");
this.State = WorkerExecutionState.Waiting;
@@ -93,6 +93,7 @@ public abstract class BaseWorker : Identifiable
});
task.Start();
this.State = WorkerExecutionState.Running;
callback?.Invoke();
return task;
}