job status reporting

This commit is contained in:
EugeneTes
2026-02-03 10:52:27 +01:00
parent f660b5119c
commit d738699acc
7 changed files with 31 additions and 4 deletions

View File

@@ -5,15 +5,17 @@ public class PrintServer
{
private readonly IPrintService _printService;
private readonly ILogger _logger;
private readonly IJobStatusReporter _statusReporter;
private readonly ConcurrentDictionary<string, PrinterQueue> _printerQueues;
private readonly SemaphoreSlim _printDiscoveryLock = new(1, 1);
private int _readerCount = 0;
private readonly object _readerCountLock = new();
public PrintServer(IPrintService printService, ILogger logger)
public PrintServer(IPrintService printService, ILogger logger, IJobStatusReporter statusReporter)
{
_printService = printService;
_logger = logger;
_statusReporter = statusReporter;
_printerQueues = new ConcurrentDictionary<string, PrinterQueue>();
}
@@ -76,7 +78,7 @@ public class PrintServer
public void RegisterPrinter(string printerIp)
{
var queue = new PrinterQueue(printerIp, _printService, _logger, this);
var queue = new PrinterQueue(printerIp, _printService, _logger, this, _statusReporter);
if (_printerQueues.TryAdd(printerIp, queue))
{
queue.Start();