Show / Hide Table of Contents

Class AsyncQueueProcessor<TQueue, TItem>

Base class for hosted service processing items from an async queue

Inheritance
object
BackgroundService
AsyncQueueProcessor<TQueue, TItem>
WebhookDispatcher
TrackEventSender
Implements
IDisposable
IHostedService
Inherited Members
BackgroundService.StartAsync(CancellationToken)
BackgroundService.StopAsync(CancellationToken)
BackgroundService.Dispose()
object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
Namespace: SuperOffice.Threading
Assembly: SoCore.dll
Syntax
public abstract class AsyncQueueProcessor<TQueue, TItem> : BackgroundService, IDisposable, IHostedService where TQueue : IAsyncQueueBase<TItem>
Type Parameters
Name Description
TQueue
TItem

Item in the queue

Constructors

AsyncQueueProcessor(TQueue)

Default Constructor

Declaration
protected AsyncQueueProcessor(TQueue queue)
Parameters
Type Name Description
TQueue queue

Fields

_queue

Base class for hosted service processing items from an async queue

Declaration
protected readonly TQueue _queue
Field Value
Type Description
TQueue

Methods

ExecuteAsync(CancellationToken)

Base class for hosted service processing items from an async queue

Declaration
protected override Task ExecuteAsync(CancellationToken stoppingToken)
Parameters
Type Name Description
CancellationToken stoppingToken
Returns
Type Description
Task
Overrides
BackgroundService.ExecuteAsync(CancellationToken)

ProcessItemAsync(IAsyncQueueProcessItemContext<TItem>, CancellationToken)

Process an item from the queue

Declaration
protected abstract Task ProcessItemAsync(IAsyncQueueProcessItemContext<TItem> context, CancellationToken cancellationToken)
Parameters
Type Name Description
IAsyncQueueProcessItemContext<TItem> context

Context of item to be processed

CancellationToken cancellationToken
Returns
Type Description
Task

Implements

IDisposable
IHostedService

Extension Methods

EnumUtil.MapEnums<From, To>(From)
Converters.MapEnums<From, To>(From)
© SuperOffice. All rights reserved.
SuperOffice |  Community |  Release Notes |  Privacy |  Site feedback |  Search Docs |  About Docs |  Contribute |  Back to top