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.​IHostLifetime

Assembly: Microsoft.Extensions.Hosting.Abstractions

Tracks host lifetime.

Methods

StopAsync​(System.​Threading.​CancellationToken cancellationToken)
Called from <see cref="M:Microsoft.Extensions.Hosting.IHost.StopAsync(System.Threading.CancellationToken)" /> to indicate that the host is stopping and it's time to shut down.
Returns A <see cref="T:System.Threading.Tasks.Task" /> .
cancellationToken Used to indicate when stop should no longer be graceful.
WaitForStartAsync​(System.​Threading.​CancellationToken cancellationToken)
Called at the start of <see cref="M:Microsoft.Extensions.Hosting.IHost.StartAsync(System.Threading.CancellationToken)" /> which will wait until it's complete before continuing. This can be used to delay startup until signaled by an external event.
Returns A <see cref="T:System.Threading.Tasks.Task" /> .
cancellationToken Used to abort program start.