Update doc and todo (#4)

* Updade doc

* Updade doc
This commit is contained in:
Oda
2024-07-20 21:33:50 +07:00
committed by GitHub
parent a43e560d3a
commit 743d04e6c5
12 changed files with 483 additions and 71 deletions

View File

@@ -5,11 +5,21 @@ using static Managing.Common.Enums;
namespace Managing.Api.Workers.Workers;
/// <summary>
/// Represents a worker that watches traders and performs actions based on trading activities.
/// Inherits from <see cref="BaseWorker{TWorker}"/> where TWorker is <see cref="FeeWorker"/>.
/// </summary>
public class TraderWatcher : BaseWorker<FeeWorker>
{
private readonly ITradingService _tradingService;
private static readonly WorkerType _workerType = WorkerType.TraderWatcher;
/// <summary>
/// Initializes a new instance of the <see cref="TraderWatcher"/> class.
/// </summary>
/// <param name="logger">The logger to be used by the worker.</param>
/// <param name="tradingService">The trading service to monitor trading activities.</param>
/// <param name="workerService">The worker service to manage worker lifecycle.</param>
public TraderWatcher(
ILogger<FeeWorker> logger,
ITradingService tradingService,
@@ -23,8 +33,12 @@ public class TraderWatcher : BaseWorker<FeeWorker>
_tradingService = tradingService;
}
/// <summary>
/// Executes the worker's task to watch traders. This method is called periodically based on the worker's configured interval.
/// </summary>
/// <param name="cancellationToken">A token to observe while waiting for the task to complete.</param>
protected override async Task Run(CancellationToken cancellationToken)
{
await _tradingService.WatchTrader();
}
}
}