ConsoleLifetime Class

Definition

Listens for Ctrl+C or SIGTERM and initiates shutdown.

public ref class ConsoleLifetime : IDisposable, Microsoft::Extensions::Hosting::IHostLifetime
public class ConsoleLifetime : IDisposable, Microsoft.Extensions.Hosting.IHostLifetime
[System.Runtime.Versioning.UnsupportedOSPlatform("android")]
[System.Runtime.Versioning.UnsupportedOSPlatform("browser")]
[System.Runtime.Versioning.UnsupportedOSPlatform("ios")]
[System.Runtime.Versioning.UnsupportedOSPlatform("tvos")]
public class ConsoleLifetime : IDisposable, Microsoft.Extensions.Hosting.IHostLifetime
type ConsoleLifetime = class
    interface IHostLifetime
    interface IDisposable
[<System.Runtime.Versioning.UnsupportedOSPlatform("android")>]
[<System.Runtime.Versioning.UnsupportedOSPlatform("browser")>]
[<System.Runtime.Versioning.UnsupportedOSPlatform("ios")>]
[<System.Runtime.Versioning.UnsupportedOSPlatform("tvos")>]
type ConsoleLifetime = class
    interface IHostLifetime
    interface IDisposable
Public Class ConsoleLifetime
Implements IDisposable, IHostLifetime
Inheritance
ConsoleLifetime
Attributes
Implements

Remarks

This API supports the .NET infrastructure and is not intended to be used directly from your code.

Constructors

ConsoleLifetime(IOptions<ConsoleLifetimeOptions>, IHostEnvironment, IHostApplicationLifetime, IOptions<HostOptions>)

This API supports infrastructure and is not intended to be used directly from your code. This API may change or be removed in future releases.

ConsoleLifetime(IOptions<ConsoleLifetimeOptions>, IHostEnvironment, IHostApplicationLifetime, IOptions<HostOptions>, ILoggerFactory)

This API supports infrastructure and is not intended to be used directly from your code. This API may change or be removed in future releases.

ConsoleLifetime(IOptions<ConsoleLifetimeOptions>, IHostingEnvironment, IApplicationLifetime)

This API supports infrastructure and is not intended to be used directly from your code. This API may change or be removed in future releases.

Methods

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

Equals(Object)

Determines whether the specified object is equal to the current object.

(Inherited from Object)
GetHashCode()

Serves as the default hash function.

(Inherited from Object)
GetType()

Gets the Type of the current instance.

(Inherited from Object)
MemberwiseClone()

Creates a shallow copy of the current Object.

(Inherited from Object)
StopAsync(CancellationToken)

Called from StopAsync(CancellationToken) to indicate that the host is stopping and it's time to shut down.

ToString()

Returns a string that represents the current object.

(Inherited from Object)
WaitForStartAsync(CancellationToken)

Called at the start of StartAsync(CancellationToken), which will wait until it's complete before continuing. This can be used to delay startup until signaled by an external event.

Applies to