Table of Contents

Class ConsumerProgressListener

Namespace
Virtufin.Api.Services
Assembly
Virtufin.Api.dll

Keeps this pod's ConsumerProgress current: subscribes to the gateway's progress topic (sys.api.pubsub.progress.reported), on which every pod publishes the positions reported to it (Pubsub.ReportProgress). Each pod has its own Dapr consumer group, so every pod sees every report.

public sealed class ConsumerProgressListener : BackgroundService, IHostedService, IDisposable
Inheritance
ConsumerProgressListener
Implements
Inherited Members

Constructors

ConsumerProgressListener(TopicDaprSubscriptionRegistry, ConsumerProgress, ILogger<ConsumerProgressListener>)

Keeps this pod's ConsumerProgress current: subscribes to the gateway's progress topic (sys.api.pubsub.progress.reported), on which every pod publishes the positions reported to it (Pubsub.ReportProgress). Each pod has its own Dapr consumer group, so every pod sees every report.

public ConsumerProgressListener(TopicDaprSubscriptionRegistry registry, ConsumerProgress progress, ILogger<ConsumerProgressListener> logger)

Parameters

registry TopicDaprSubscriptionRegistry
progress ConsumerProgress
logger ILogger<ConsumerProgressListener>

Fields

Topic

sys.api.pubsub.progress.reported.

public static readonly string Topic

Field Value

string

Type

The ce-type of a progress report.

public static readonly string Type

Field Value

string

Methods

ExecuteAsync(CancellationToken)

This method is called when the IHostedService starts. The implementation should return a task that represents the lifetime of the long running operation(s) being performed.

protected override Task ExecuteAsync(CancellationToken stoppingToken)

Parameters

stoppingToken CancellationToken

Triggered when StopAsync(CancellationToken) is called.

Returns

Task

A Task that represents the long running operations.

Remarks

See Worker Services in .NET for implementation guidelines.