Class WebhookSlowDispatcher
Hosted Service responsible for processing the slow Webhook queue held by the WebhookManager
Inheritance
AsyncQueueProcessor<IAsyncQueue<(ICustomWebhookPlugin, Webhook, WebhookPayload)>, (ICustomWebhookPlugin, Webhook, WebhookPayload)>
WebhookSlowDispatcher
Inherited Members
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
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 |