Skip to content

Commit 46f63f2

Browse files
committed
[add] Stop/StopAsync methods to MultitaskScheduler for programmatic shutdown
1 parent 3136dc3 commit 46f63f2

3 files changed

Lines changed: 27 additions & 1 deletion

File tree

‎src/Simplify.Scheduler/CHANGELOG.md‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Changelog
22

3+
## [1.8.0] - 2026-08-19
4+
5+
### Added
6+
7+
- Public `Stop`/`StopAsync` methods to shut the scheduler down programmatically (previously a running `Start`/`StartAsync` could only be released via `Ctrl + C`), enabling hosting and testing scenarios
8+
39
## [1.7.0] - 2026-06-25
410

511
### Fixed

‎src/Simplify.Scheduler/MultitaskScheduler.cs‎

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,26 @@ public bool Start(string[]? args = null)
7474
return true;
7575
}
7676

77+
/// <summary>
78+
/// Stops the scheduler, releasing a blocked <see cref="Start" /> / <see cref="StartAsync" /> call.
79+
/// </summary>
80+
public void Stop()
81+
{
82+
StopJobs();
83+
84+
_closing.Set();
85+
}
86+
87+
/// <summary>
88+
/// Stops the scheduler asynchronously, releasing a blocked <see cref="StartAsync" /> call.
89+
/// </summary>
90+
public Task StopAsync()
91+
{
92+
Stop();
93+
94+
return Task.CompletedTask;
95+
}
96+
7797
/// <summary>
7898
/// Called when scheduler is about to stop, main stopping point
7999
/// </summary>

‎src/Simplify.Scheduler/Simplify.Scheduler.csproj‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
99
<GenerateDocumentationFile>true</GenerateDocumentationFile>
1010

11-
<Version>1.7.0</Version>
11+
<Version>1.8.0</Version>
1212

1313
<Description>Scheduler framework with DI</Description>
1414
<Product>Simplify</Product>

0 commit comments

Comments
 (0)