Class TaskHostExtensions
- Namespace
- Steeltoe.Management.Tasks
- Assembly
- Steeltoe.Management.Tasks.dll
public static class TaskHostExtensions
- Inheritance
-
TaskHostExtensions
- Inherited Members
Methods
HasApplicationTask(IWebHost)
Indicates whether RunWithTasksAsync(IWebHost, CancellationToken) will run an application task, instead of the regular application.
public static bool HasApplicationTask(this IWebHost host)
Parameters
Returns
HasApplicationTask(IHost)
Indicates whether RunWithTasksAsync(IHost, CancellationToken) will run an application task, instead of the regular application.
public static bool HasApplicationTask(this IHost host)
Parameters
Returns
RunWithTasksAsync(IWebHost, CancellationToken)
Runs an application task if available, or runs the application normally otherwise.
To register your application task, use one of the extension methods in TaskServiceCollectionExtensions. To execute the registered task, invoke the application with command-line argument "RunTask=taskName", where "taskName" is your task's name (case-sensitive).
Command line arguments must be registered as a configuration source for this functionality to work.
public static Task RunWithTasksAsync(this IWebHost host, CancellationToken cancellationToken)
Parameters
hostIWebHostThe IWebHost to run.
cancellationTokenCancellationTokenThe token to trigger shutdown.
Returns
RunWithTasksAsync(IHost, CancellationToken)
Runs an application task if available, or starts the application normally otherwise.
To register your application task, use one of the extension methods in TaskServiceCollectionExtensions. To execute the registered task, invoke the application with command-line argument "RunTask=taskName", where "taskName" is your task's name (case-sensitive).
Command line arguments must be registered as a configuration source for this functionality to work.
public static Task RunWithTasksAsync(this IHost host, CancellationToken cancellationToken)
Parameters
hostIHostThe IHost to run.
cancellationTokenCancellationTokenThe token to trigger shutdown.