Table of Contents

Class ExitWatchtowerBackgroundService

Namespace
NArk.Core.Services
Assembly
NArk.Core.dll

Background service that periodically runs the exit watchtower check. Register as IHostedService for autonomous monitoring.

public class ExitWatchtowerBackgroundService : BackgroundService, IHostedService, IDisposable
Inheritance
ExitWatchtowerBackgroundService
Implements
Inherited Members

Constructors

ExitWatchtowerBackgroundService(ExitWatchtowerService, UnilateralExitService, IOptions<ExitWatchtowerOptions>, ILogger<ExitWatchtowerBackgroundService>?)

Background service that periodically runs the exit watchtower check. Register as IHostedService for autonomous monitoring.

public ExitWatchtowerBackgroundService(ExitWatchtowerService watchtower, UnilateralExitService exitService, IOptions<ExitWatchtowerOptions> options, ILogger<ExitWatchtowerBackgroundService>? logger = null)

Parameters

watchtower ExitWatchtowerService
exitService UnilateralExitService
options IOptions<ExitWatchtowerOptions>
logger ILogger<ExitWatchtowerBackgroundService>

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.