R4: Worker von WorkerEngine auf IHostedService (Generic Host)

- WorkerBase implementiert IHostedService (StartAsync/StopAsync mit CancellationToken,
  eigener CTS, Guard auf Info.Active); IWorker auf Metadaten + TriggerAsync reduziert
- Worker via AddHostedService registriert (Core + Modul); AppHost.Start() startet sie,
  AppHost.StopAsync() stoppt sie
- WorkerEngine auf leichte Registry reduziert (WorkerInfos fuer UI + TriggerWorkerAsync)
- LauncherForm startet/stoppt keine Worker mehr (Host-getrieben)
- Hosting.Abstractions im Core; Tests angepasst -> 43/43 gruen; smoke-ui + App-Start ok

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@
This commit is contained in:
Richard
2026-07-28 18:39:14 +02:00
parent 475c0b41cb
commit 19dac18050
9 changed files with 67 additions and 106 deletions
@@ -82,7 +82,7 @@ public class WorkerBaseTests
worker.Runs.Should().Be(1);
await worker.StopAsync();
await worker.StopAsync(CancellationToken.None);
}
[Fact]
@@ -97,7 +97,7 @@ public class WorkerBaseTests
await worker.TriggerAsync();
await WaitUntilAsync(() => worker.Runs == 2, "Trigger löst zweiten Lauf aus");
await worker.StopAsync();
await worker.StopAsync(CancellationToken.None);
}
[Fact]
@@ -112,7 +112,7 @@ public class WorkerBaseTests
worker.Runs.Should().Be(1);
worker.Info.Info.Should().Contain("boom");
await worker.StopAsync();
await worker.StopAsync(CancellationToken.None);
}
[Fact]
@@ -122,7 +122,7 @@ public class WorkerBaseTests
await worker.StartAsync(CancellationToken.None);
await WaitUntilAsync(() => worker.Runs == 1, "erster Lauf erfolgt");
await worker.StopAsync();
await worker.StopAsync(CancellationToken.None);
worker.Info.Status.Should().Be(WorkerStatus.Stopped);
}