Constructor AgentTaskSchedulerService
- Namespace
- Oscova.Agents.Tasks
- Assembly
- Oscova.Agents.dll
AgentTaskSchedulerService(IServiceProvider, NotificationHub<TaskStatusUpdate>, ILogger<AgentTaskSchedulerService>, TimeProvider, Func<AgentTaskDefinition, CancellationToken, Task<bool>>?, Func<string, bool>?)
Background scheduler that starts enabled agent tasks when their schedules become due.
public AgentTaskSchedulerService(IServiceProvider serviceProvider, NotificationHub<TaskStatusUpdate> taskStatusNotifications, ILogger<AgentTaskSchedulerService> logger, TimeProvider timeProvider, Func<AgentTaskDefinition, CancellationToken, Task<bool>>? canScheduleTaskAsync = null, Func<string, bool>? canRunUser = null)Parameters
serviceProviderIServiceProvider-
The root service provider used to create scoped task services.
taskStatusNotificationsNotificationHub<TaskStatusUpdate>-
The notification hub used to publish task status updates.
loggerILogger<AgentTaskSchedulerService>-
The logger used for scheduler activity and failures.
timeProviderTimeProvider-
The clock used for scheduler ticks and run timestamps.
canScheduleTaskAsyncFunc<AgentTaskDefinition, CancellationToken, Task<bool>>?-
Caller-owned eligibility for timer-driven starts. False leaves the task due without a run.
canRunUserFunc<string, bool>?-
Caller-owned vault eligibility for starting and persisting any run.