Table of Contents

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

serviceProvider IServiceProvider

The root service provider used to create scoped task services.

taskStatusNotifications NotificationHub<TaskStatusUpdate>

The notification hub used to publish task status updates.

logger ILogger<AgentTaskSchedulerService>

The logger used for scheduler activity and failures.

timeProvider TimeProvider

The clock used for scheduler ticks and run timestamps.

canScheduleTaskAsync Func<AgentTaskDefinition, CancellationToken, Task<bool>>?

Caller-owned eligibility for timer-driven starts. False leaves the task due without a run.

canRunUser Func<string, bool>?

Caller-owned vault eligibility for starting and persisting any run.