You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
783 B
33 lines
783 B
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); |
|
} |
|
}
|
|
|