SchedulerService.ScheduleAsync method (1 of 2)
Asynchronously schedules a script job from a file to run according to a cron expression.
public Task ScheduleAsync(string name, string cron, FileInfo fileInfo, ScriptLanguage lang,
bool runImmediately = false, CancellationToken ct = default)
| parameter | description |
|---|---|
| name | The name of the job. |
| cron | The cron expression specifying the job schedule. |
| fileInfo | The file containing the script code to execute. |
| lang | The language of the script (e.g., PowerShell, CSharp). |
| runImmediately | Whether to run the job immediately upon scheduling. |
| ct | The cancellation token to cancel the operation. |
See Also
- enum ScriptLanguage
- class SchedulerService
- namespace Kestrun.Scheduling
SchedulerService.ScheduleAsync method (2 of 2)
Asynchronously schedules a script job from a file to run at a specified interval.
public Task ScheduleAsync(string name, TimeSpan interval, FileInfo fileInfo, ScriptLanguage lang,
bool runImmediately = false, CancellationToken ct = default)
| parameter | description |
|---|---|
| name | The name of the job. |
| interval | The interval between job executions. |
| fileInfo | The file containing the script code to execute. |
| lang | The language of the script (e.g., PowerShell, CSharp). |
| runImmediately | Whether to run the job immediately upon scheduling. |
| ct | The cancellation token to cancel the operation. |
See Also
- enum ScriptLanguage
- class SchedulerService
- namespace Kestrun.Scheduling