Class HostedServiceSampleImplementation
Implements
Namespace: Coree.NETStandard.HostedService
Assembly: Coree.NETStandard.dll
Syntax
public class HostedServiceSampleImplementation : IHostedService
Constructors
| Edit this page View SourceHostedServiceSampleImplementation(IHostedServicesCollectionOptionsProvider<HostedServiceSampleImplementationOptions>, ILogger<HostedServiceSampleImplementation>)
Declaration
public HostedServiceSampleImplementation(IHostedServicesCollectionOptionsProvider<HostedServiceSampleImplementationOptions> optionsList, ILogger<HostedServiceSampleImplementation> logger)
Parameters
Type | Name | Description |
---|---|---|
IHostedServicesCollectionOptionsProvider<HostedServiceSampleImplementationOptions> | optionsList | |
ILogger<HostedServiceSampleImplementation> | logger |
Methods
| Edit this page View SourceStartAsync(CancellationToken)
Triggered when the application host is ready to start the service.
Declaration
public Task StartAsync(CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
CancellationToken | cancellationToken | Indicates that the start process has been aborted. |
Returns
Type | Description |
---|---|
Task | A Task that represents the asynchronous Start operation. |
StopAsync(CancellationToken)
Triggered when the application host is performing a graceful shutdown.
Declaration
public Task StopAsync(CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
CancellationToken | cancellationToken | Indicates that the shutdown process should no longer be graceful. |
Returns
Type | Description |
---|---|
Task | A Task that represents the asynchronous Stop operation. |