namespace tias.deep.CMS; public class Worker : BackgroundService { private tias.deep.server.cms.DeepServer _server; public Worker() { this._server = new server.cms.DeepServer(); } public override Task StartAsync(CancellationToken cancellationToken) { _server.Start(); return base.StartAsync(cancellationToken); } protected override async Task ExecuteAsync(CancellationToken stoppingToken) { while (!stoppingToken.IsCancellationRequested) { await Task.Delay(1000, stoppingToken); } } public override Task StopAsync(CancellationToken cancellationToken) { _server.Stop(); return base.StopAsync(cancellationToken); } }