CosmosRepositoryChangeFeedHostedService
A `BackgroundService` to start and stop the `IChangeFeedService`
Namespace: Microsoft.Azure.CosmosRepository.AspNetCore
Kind: class
A BackgroundService to start and stop the IChangeFeedService
public class CosmosRepositoryChangeFeedHostedService : BackgroundService, IHostedService, IDisposableRemarks
Creates an instance of the CosmosRepositoryChangeFeedHostedService
Example
Members
Constructor
CosmosRepositoryChangeFeedHostedService.CosmosRepositoryChangeFeedHostedService(IChangeFeedService)
A BackgroundService to start and stop the IChangeFeedService
public CosmosRepositoryChangeFeedHostedService(IChangeFeedService changeFeedService)Parameters
| Name | Type | Description |
|---|---|---|
changeFeedService | IChangeFeedService | The IChangeFeedService to start. |
Creates an instance of the CosmosRepositoryChangeFeedHostedService
Methods
CosmosRepositoryChangeFeedHostedService.StartAsync(CancellationToken)
Starts the IChangeFeedService.
public override Task StartAsync(CancellationToken cancellationToken)Parameters
| Name | Type | Description |
|---|---|---|
cancellationToken | CancellationToken | — |
Returns — Task
CosmosRepositoryChangeFeedHostedService.StopAsync(CancellationToken)
Stops the IChangeFeedService.
public override Task StopAsync(CancellationToken cancellationToken)Parameters
| Name | Type | Description |
|---|---|---|
cancellationToken | CancellationToken | — |
Returns — Task
CosmosRepositoryChangeFeedHostedService.ExecuteAsync(CancellationToken)
Background execution is not used because startup and shutdown are explicitly
delegated to the IChangeFeedService.
protected override Task ExecuteAsync(CancellationToken stoppingToken)Parameters
| Name | Type | Description |
|---|---|---|
stoppingToken | CancellationToken | — |
Returns — Task