Interface IBackgroundTaskQueue
A Background Task Queue, to enqueue tasks for executing in the background.
Namespace: Umbraco.Cms.Infrastructure.HostedServices
Assembly: Umbraco.Infrastructure.dll
Syntax
public interface IBackgroundTaskQueue
Remarks
Borrowed from https://docs.microsoft.com/en-us/aspnet/core/fundamentals/host/hosted-services?view=aspnetcore-5.0
Methods
View SourceDequeueAsync(CancellationToken)
Dequeue the first item on the queue.
Declaration
Task<Func<CancellationToken, Task>?> DequeueAsync(CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<System.Nullable<Func<CancellationToken, Task>>> |
QueueBackgroundWorkItem(Func<CancellationToken, Task>)
Enqueue a work item to be executed on in the background.
Declaration
void QueueBackgroundWorkItem(Func<CancellationToken, Task> workItem)
Parameters
Type | Name | Description |
---|---|---|
Func<CancellationToken, Task> | workItem |