Class WebhookDispatcher
Hosted Service responsible for processing the Webhook queue held by the WebhookManager. Calls WebhookManager.NotifyWebhooksAsync to process each item in the queue.
Inheritance
WebhookDispatcher
Inherited Members
Namespace: SuperOffice.CRM.Webhooks
Assembly: SoDataBase.BusinessLogic.dll
Syntax
public class WebhookDispatcher : AsyncQueueProcessor<IAsyncQueue<WebhookTaskInfo>, WebhookTaskInfo>, IDisposable, IHostedService
Constructors
WebhookDispatcher(IWebhookManager, IAsyncQueue<WebhookTaskInfo>, ILogger<WebhookDispatcher>)
Constructor called by Hosted Service / DI
Declaration
public WebhookDispatcher(IWebhookManager webhookManager, IAsyncQueue<WebhookTaskInfo> queue, ILogger<WebhookDispatcher> logger)
Parameters
| Type | Name | Description |
|---|---|---|
| IWebhookManager | webhookManager | |
| IAsyncQueue<WebhookTaskInfo> | queue | |
| ILogger<WebhookDispatcher> | logger |
Methods
ProcessItemAsync(IAsyncQueueProcessItemContext<WebhookTaskInfo>, CancellationToken)
Calls WebhookManager.NotifyWebhooksAsync to process each item in the queue.
Declaration
protected override Task ProcessItemAsync(IAsyncQueueProcessItemContext<WebhookTaskInfo> context, CancellationToken cancellationToken)
Parameters
| Type | Name | Description |
|---|---|---|
| IAsyncQueueProcessItemContext<WebhookTaskInfo> | context | |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task |