Table of Contents

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

host IWebHost

The IWebHost to run from.

Returns

bool

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

host IHost

The IHost to run from.

Returns

bool

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

host IWebHost

The IWebHost to run.

cancellationToken CancellationToken

The token to trigger shutdown.

Returns

Task

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

host IHost

The IHost to run.

cancellationToken CancellationToken

The token to trigger shutdown.

Returns

Task