Class Application
The main application which coordinates the logic carried out by the CLI app. Note that in production usage this is created and started by a .NET Generic Host, which is set up by Program.
Inheritance
System.Object
Application
Implements
Microsoft.Extensions.Hosting.IHostedService
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: ZptSharp.Cli
Assembly: ZptSharp.Cli.dll
Syntax
public class Application : IHostedService
Constructors
| Improve this Doc View SourceApplication(IRendersManyFiles, IGetsBulkRenderingRequest, CliArguments, IHostApplicationLifetime)
Initializes a new instance of Application
Declaration
public Application(IRendersManyFiles renderer, IGetsBulkRenderingRequest requestFactory, CliArguments args, IHostApplicationLifetime appLifetime)
Parameters
Type | Name | Description |
---|---|---|
IRendersManyFiles | renderer | The bulk-renderer. |
IGetsBulkRenderingRequest | requestFactory | The request factory. |
CliArguments | args | The command-line args. |
Microsoft.Extensions.Hosting.IHostApplicationLifetime | appLifetime | The app lifetime. |
Methods
| Improve this Doc View SourceStartAsync(CancellationToken)
Starts the application asynchronously.
Declaration
public Task StartAsync(CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
System.Threading.CancellationToken | cancellationToken | A cancellation token. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task | A task which completes once the app has done its work. |
StopAsync(CancellationToken)
Handles graceful-shutdown for the application.
Declaration
public Task StopAsync(CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
System.Threading.CancellationToken | cancellationToken | A cancellation token. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task | A task which completes immediately. |
Implements
Microsoft.Extensions.Hosting.IHostedService