C# Class Microsoft.AspNet.WebHooks.AzureWebHookDequeueManager

Provides an event loop which dequeues messages from a Microsoft Azure Queue and then sends the WebHook to the recipients. If the delivery success then the message is removed from the queue, otherwise it remains so that another attempt can be made. After a given number of attempts the message is discarded without being delivered.
Inheritance: IDisposable
Afficher le fichier Open project: aspnet/WebHooks Class Usage Examples

Private Properties

Свойство Type Description
AzureWebHookDequeueManager System

Méthodes publiques

Méthode Description
AzureWebHookDequeueManager ( string connectionString, ILogger logger ) : System

Initializes a new instance of the AzureWebHookDequeueManager using the given connectionString to identify the Microsoft Azure Storage Queue.

AzureWebHookDequeueManager ( string connectionString, ILogger logger, System.TimeSpan pollingFrequency, System.TimeSpan messageTimeout, int maxAttempts ) : System

Initializes a new instance of the AzureWebHookDequeueManager using the given connectionString to identify the Microsoft Azure Storage Queue.

Dispose ( ) : void
Start ( CancellationToken cancellationToken ) : Task

Start the event loop of requesting messages from the queue and send them out as WebHooks.

Méthodes protégées

Méthode Description
DequeueAndSendWebHooks ( CancellationToken cancellationToken ) : Task

Dequeues available WebHooks and sends them out to each WebHook recipient.

Dispose ( bool disposing ) : void

Private Methods

Méthode Description
AzureWebHookDequeueManager ( string connectionString, ILogger logger, System.TimeSpan pollingFrequency, System.TimeSpan messageTimeout, int maxAttempts, HttpClient httpClient, IStorageManager storageManager, WebHookSender sender ) : System

Intended for unit test purposes

Method Details

AzureWebHookDequeueManager() public méthode

Initializes a new instance of the AzureWebHookDequeueManager using the given connectionString to identify the Microsoft Azure Storage Queue.
public AzureWebHookDequeueManager ( string connectionString, ILogger logger ) : System
connectionString string The Microsoft Azure Storage Queue connection string.
logger ILogger The instance to use for logging errors and warnings.
Résultat System

AzureWebHookDequeueManager() public méthode

Initializes a new instance of the AzureWebHookDequeueManager using the given connectionString to identify the Microsoft Azure Storage Queue.
public AzureWebHookDequeueManager ( string connectionString, ILogger logger, System.TimeSpan pollingFrequency, System.TimeSpan messageTimeout, int maxAttempts ) : System
connectionString string The Microsoft Azure Storage Queue connection string.
logger ILogger The instance to use for logging errors and warnings.
pollingFrequency System.TimeSpan The polling frequency by which we request messages from the queue.
messageTimeout System.TimeSpan The time allotted to send out the WebHooks request and get a response. If /// the request has not completed within this time frame, the message will be considered to have failed and /// it will be attempted again.
maxAttempts int The maximum number of attempts to deliver the WebHook.
Résultat System

DequeueAndSendWebHooks() protected méthode

Dequeues available WebHooks and sends them out to each WebHook recipient.
protected DequeueAndSendWebHooks ( CancellationToken cancellationToken ) : Task
cancellationToken System.Threading.CancellationToken
Résultat Task

Dispose() public méthode

public Dispose ( ) : void
Résultat void

Dispose() protected méthode

protected Dispose ( bool disposing ) : void
disposing bool
Résultat void

Start() public méthode

Start the event loop of requesting messages from the queue and send them out as WebHooks.
public Start ( CancellationToken cancellationToken ) : Task
cancellationToken System.Threading.CancellationToken A which can be used to terminate the event loop.
Résultat Task