Skip to main content
Table of Contents

Class BackgroundTaskExtensions

Namespace
Microsoft.Extensions.DependencyInjection
Assembly
Stratara.Infrastructure.dll

Service-collection extensions that wire the in-process background-task queue and its drain worker.

public static class BackgroundTaskExtensions
Inheritance
BackgroundTaskExtensions
Inherited Members

Methods

AddBackgroundTasks(IServiceCollection)

Registers Stratara.Infrastructure.BackgroundTasks.QueuedHostedService and a singleton IBackgroundTaskQueue with a default capacity of 100 pending items.

public static IServiceCollection AddBackgroundTasks(this IServiceCollection services)

Parameters

services IServiceCollection

The service collection.

Returns

IServiceCollection

The same service collection for chaining.

Examples

services.AddBackgroundTasks();