Early Preview
This is currently very much a preview. Please feel free to try things out,
but don't be upset if anything is not yet working. Feedback is welcome over on our
GitHub Dicussions page.
interface Microsoft.​Extensions.​Hosting.​IHostedService
Assembly: Microsoft.Extensions.Hosting.Abstractions
Defines methods for objects that are managed by the host.
Methods
StartAsync​(System.​Threading.​CancellationToken cancellationToken)
Triggered when the application host is ready to start the service.
Returns A <see cref="T:System.Threading.Tasks.Task" /> that represents the asynchronous Start operation.
cancellationToken
Indicates that the start process has been aborted.
StopAsync​(System.​Threading.​CancellationToken cancellationToken)
Triggered when the application host is performing a graceful shutdown.
Returns A <see cref="T:System.Threading.Tasks.Task" /> that represents the asynchronous Stop operation.
cancellationToken
Indicates that the shutdown process should no longer be graceful.