SystemdLifetime Class

Definition

Provides notification messages for application started and stopping, and configures console logging to the systemd format.

C#
[System.Runtime.Versioning.UnsupportedOSPlatform("android")]
[System.Runtime.Versioning.UnsupportedOSPlatform("browser")]
[System.Runtime.Versioning.UnsupportedOSPlatform("ios")]
[System.Runtime.Versioning.UnsupportedOSPlatform("maccatalyst")]
[System.Runtime.Versioning.UnsupportedOSPlatform("tvos")]
public class SystemdLifetime : IDisposable, Microsoft.Extensions.Hosting.IHostLifetime
C#
public class SystemdLifetime : IDisposable, Microsoft.Extensions.Hosting.IHostLifetime
Inheritance
SystemdLifetime
Attributes
Implements

Constructors

Methods

Dispose()

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

StopAsync(CancellationToken)

Asynchronously stops and shuts down the host. This method is called from StopAsync(CancellationToken).

WaitForStartAsync(CancellationToken)

Asynchronously waits until the start operation is complete before continuing. This method is called at the beginning of StartAsync(CancellationToken). This can be used to delay startup until signaled by an external event.

Applies to

Product Versions
.NET 8 (package-provided), 9 (package-provided), 10 (package-provided)
.NET Standard 2.1 (package-provided)