Show / Hide Table of Contents

Class WebhookSlowDispatcher

Hosted Service responsible for processing the slow Webhook queue held by the WebhookManager

Inheritance
object
BackgroundService
AsyncQueueProcessor<IAsyncQueue<(ICustomWebhookPlugin, Webhook, WebhookPayload)>, (ICustomWebhookPlugin, Webhook, WebhookPayload)>
WebhookSlowDispatcher
Implements
IDisposable
IHostedService
Inherited Members
AsyncQueueProcessor<IAsyncQueue<(ICustomWebhookPlugin, Webhook, WebhookPayload)>, (ICustomWebhookPlugin, Webhook, WebhookPayload)>._queue
AsyncQueueProcessor<IAsyncQueue<(ICustomWebhookPlugin, Webhook, WebhookPayload)>, (ICustomWebhookPlugin, Webhook, WebhookPayload)>.ExecuteAsync(CancellationToken)
AsyncQueueProcessor<IAsyncQueue<(ICustomWebhookPlugin, Webhook, WebhookPayload)>, (ICustomWebhookPlugin, Webhook, WebhookPayload)>.OuterProcessItemAsync(IAsyncQueueProcessItemContext<(ICustomWebhookPlugin, Webhook, WebhookPayload)>, CancellationToken)
AsyncQueueProcessor<IAsyncQueue<(ICustomWebhookPlugin, Webhook, WebhookPayload)>, (ICustomWebhookPlugin, Webhook, WebhookPayload)>.ProcessItemAsync(IAsyncQueueProcessItemContext<(ICustomWebhookPlugin, Webhook, WebhookPayload)>, CancellationToken)
BackgroundService.ExecuteAsync(CancellationToken)
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.CRM.Webhooks
Assembly: SoDataBase.BusinessLogic.dll
Syntax
public class WebhookSlowDispatcher : AsyncQueueProcessor<IAsyncQueue<(ICustomWebhookPlugin, Webhook, WebhookPayload)>, (ICustomWebhookPlugin, Webhook, WebhookPayload)>, IDisposable, IHostedService

Constructors

WebhookSlowDispatcher(IWebhookManager, IAsyncQueue<(ICustomWebhookPlugin, Webhook, WebhookPayload)>, ILogger<WebhookSlowDispatcher>)

Constructor called by Hosted Service / DI

Declaration
public WebhookSlowDispatcher(IWebhookManager webhookManager, IAsyncQueue<(ICustomWebhookPlugin, Webhook, WebhookPayload)> queue, ILogger<WebhookSlowDispatcher> logger)
Parameters
Type Name Description
IWebhookManager webhookManager
IAsyncQueue<(ICustomWebhookPlugin, Webhook, WebhookPayload)> queue
ILogger<WebhookSlowDispatcher> logger

Methods

ProcessItemAsync(IAsyncQueueProcessItemContext<(ICustomWebhookPlugin, Webhook, WebhookPayload)>, CancellationToken)

Process slow webhook by calling the plugin's NotifyAsync method.

Declaration
protected override Task ProcessItemAsync(IAsyncQueueProcessItemContext<(ICustomWebhookPlugin, Webhook, WebhookPayload)> context, CancellationToken cancellationToken)
Parameters
Type Name Description
IAsyncQueueProcessItemContext<(ICustomWebhookPlugin, Webhook, WebhookPayload)> context
CancellationToken cancellationToken
Returns
Type Description
Task
Overrides
AsyncQueueProcessor<IAsyncQueue<(ICustomWebhookPlugin, Webhook, WebhookPayload)>, (ICustomWebhookPlugin, Webhook, WebhookPayload)>.ProcessItemAsync(IAsyncQueueProcessItemContext<(ICustomWebhookPlugin, Webhook, WebhookPayload)>, CancellationToken)

WaitForAllToComplete(CancellationToken)

Hosted Service responsible for processing the slow Webhook queue held by the WebhookManager

Declaration
public Task WaitForAllToComplete(CancellationToken cancellationToken)
Parameters
Type Name Description
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