Class DefaultAppShutdownAwaiter
A default application shutdown awaiter.
Implements
Inherited Members
Namespace: Kephas.Application
Assembly: Kephas.Application.dll
Syntax
[OverridePriority(Priority.Low)]
public class DefaultAppShutdownAwaiter : IAppShutdownAwaiter
Constructors
| Improve this Doc View SourceDefaultAppShutdownAwaiter(IEventHub)
Initializes a new instance of the DefaultAppShutdownAwaiter class.
Declaration
public DefaultAppShutdownAwaiter(IEventHub eventHub)
Parameters
Type | Name | Description |
---|---|---|
IEventHub | eventHub | The event hub. |
Properties
| Improve this Doc View SourceIsAttended
Gets or sets a value indicating whether the application is attended/interactive.
Declaration
public bool IsAttended { get; protected set; }
Property Value
Type | Description |
---|---|
System.Boolean | True if the application is attended/interactive, false if not. |
Methods
| Improve this Doc View SourceGetAttendedResult()
Gets the attended result.
Declaration
protected virtual IOperationResult GetAttendedResult()
Returns
Type | Description |
---|---|
IOperationResult | The attended result. |
GetUnattendedResult()
Gets the unattended result.
Declaration
protected virtual IOperationResult GetUnattendedResult()
Returns
Type | Description |
---|---|
IOperationResult | The unattended result. |
HandleShutdownSignal()
Handles the shutdown signal.
Declaration
protected virtual void HandleShutdownSignal()
RunAttendedAsync(CancellationToken)
Executes the attended asynchronous operation.
Declaration
protected virtual Task RunAttendedAsync(CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
System.Threading.CancellationToken | cancellationToken | A token that allows processing to be cancelled. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task | An asynchronous result. |
RunUnattendedAsync(CancellationToken)
Executes the unattended asynchronous operation.
Declaration
protected virtual Task RunUnattendedAsync(CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
System.Threading.CancellationToken | cancellationToken | A token that allows processing to be cancelled. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task | An asynchronous result. |
WaitForShutdownSignalAsync(CancellationToken)
Waits for the shutdown signal asynchronously.
Declaration
public Task<(IOperationResult result, AppShutdownInstruction instruction)> WaitForShutdownSignalAsync(CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type | Name | Description |
---|---|---|
System.Threading.CancellationToken | cancellationToken | Optional. A token that allows processing to be cancelled. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<System.ValueTuple<IOperationResult, AppShutdownInstruction>> | An asynchronous result that yields the shutdown result. |