Table of Contents

Class ConsumerProgress

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

Consumers' positions on topics, as reported through Pubsub.ReportProgress on any gateway pod (shared over ConsumerProgressListener), and the wait of a paced publish on them. In memory: a pod that starts knows every live consumer within one report interval.

public sealed class ConsumerProgress
Inheritance
ConsumerProgress
Inherited Members

Constructors

ConsumerProgress(PubsubPaceOptions, ILogger<ConsumerProgress>, TimeProvider?)

Consumers' positions on topics, as reported through Pubsub.ReportProgress on any gateway pod (shared over ConsumerProgressListener), and the wait of a paced publish on them. In memory: a pod that starts knows every live consumer within one report interval.

public ConsumerProgress(PubsubPaceOptions options, ILogger<ConsumerProgress> logger, TimeProvider? clock = null)

Parameters

options PubsubPaceOptions
logger ILogger<ConsumerProgress>
clock TimeProvider

Properties

Options

public PubsubPaceOptions Options { get; }

Property Value

PubsubPaceOptions

Methods

Apply(IEnumerable<ConsumerPosition>)

Applies reported positions; wakes every held publish.

public void Apply(IEnumerable<ConsumerPosition> positions)

Parameters

positions IEnumerable<ConsumerPosition>

Slowest(IEnumerable<string>, string?)

The slowest counting consumer of the topics that lags at or over the high-water mark, or null. A consumer counts unless it is self, idle, its lease ran out (it is forgotten) or it stalled.

public ConsumerProgress.Laggard? Slowest(IEnumerable<string> topics, string? self)

Parameters

topics IEnumerable<string>
self string

Returns

ConsumerProgress.Laggard?

WaitUntilCaughtUpAsync(IReadOnlyCollection<string>, string?, CancellationToken)

Returns once no counting consumer of the topics lags at or over the high-water mark, re-checking on every report and every Recheck; after MaxWait throws ResourceExhausted naming the slowest consumer.

public Task WaitUntilCaughtUpAsync(IReadOnlyCollection<string> topics, string? self, CancellationToken cancellationToken)

Parameters

topics IReadOnlyCollection<string>
self string
cancellationToken CancellationToken

Returns

Task