IHostedService 接口

定义

为主机所管理的对象定义方法。Defines methods for objects that are managed by the host.

public interface class IHostedService
public interface IHostedService
type IHostedService = interface
Public Interface IHostedService
派生

方法

StartAsync(CancellationToken)

当应用程序主机准备好启动服务时触发。Triggered when the application host is ready to start the service.

StopAsync(CancellationToken)

当应用程序主机执行正常关闭时触发。Triggered when the application host is performing a graceful shutdown.

适用于