job status reporting
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user