private void SetQ(int value, int nid) { int oldQ = Q; Q = value; if (oldQ == 0 && Q > 0) { Logger.Instance.Debug(this, "empty slot", $"N{nid}: empty slot appeared"); EmptySlotAppeared?.Invoke(); } else if (oldQ > 0 && value == 0) { Logger.Instance.Debug(this, "empty slot", $"N{nid}: empty slots ended"); EmptySlotsEnded?.Invoke(); } SlotsNumberReceived?.Invoke(nid); }
private void QueueThreadProc() { while (running) { if (commandsQueue.TryDequeue(out Command cmd)) { Queued?.Invoke(cmd.id); commandsRun.Enqueue(cmd); if (commandsRun.Count >= maxLength) { EmptySlotsEnded?.Invoke(); } SlotsNumberReceived?.Invoke(cmd.id); } Thread.Sleep(10); } }
private void RTSender_EmptySlotsEnded() { EmptySlotsEnded?.Invoke(); }