Table of Contents

Class SubscriptionHealthSweeperHostedService

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

Periodically probes every subscriber with a heartbeat write and ends the calls of those that take nothing: a full channel that took no write for Stall belongs to a client that is gone or stuck (Virtufin.Api.Services.TopicDaprSubscriptionRegistry.SweepStalled()). A subscriber that is merely behind keeps taking writes and stays. A connection that closed ends its call by itself; this is for the ones that went silent.

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

Constructors

SubscriptionHealthSweeperHostedService(TopicDaprSubscriptionRegistry, ILogger<SubscriptionHealthSweeperHostedService>)

public SubscriptionHealthSweeperHostedService(TopicDaprSubscriptionRegistry registry, ILogger<SubscriptionHealthSweeperHostedService> logger)

Parameters

registry TopicDaprSubscriptionRegistry
logger ILogger<SubscriptionHealthSweeperHostedService>

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.