Class ExitWatchtowerBackgroundService
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
watchtowerExitWatchtowerServiceexitServiceUnilateralExitServiceoptionsIOptions<ExitWatchtowerOptions>loggerILogger<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
stoppingTokenCancellationTokenTriggered when StopAsync(CancellationToken) is called.
Returns
Remarks
See Worker Services in .NET for implementation guidelines.