CiscoSparkCodec > Removed inner IF of processQueuedCommands and added CrestronInvoke to CheckSyncStatus

This commit is contained in:
Jonathan Arndt
2022-02-15 11:27:37 -08:00
parent 6df594dd7f
commit 80b5fb6c7f
2 changed files with 8 additions and 7 deletions

View File

@@ -2528,15 +2528,12 @@ ConnectorID: {2}"
private void ProcessQueuedCommands()
{
while (InitialSyncComplete)
{
if (!_commandQueue.IsEmpty)
{
var query = _commandQueue.Dequeue();
_parent.SendText(query);
}
}
}
public void AddCommandToQueue(string query)
{
@@ -2596,7 +2593,11 @@ ConnectorID: {2}"
InitialSyncComplete = true;
Debug.Console(1, this, "Initial Codec Sync Complete!");
Debug.Console(1, this, "{0} Command queued. Processing now...", _commandQueue.Count);
// Invoke a thread for the queue
CrestronInvoke.BeginInvoke((o) => {
ProcessQueuedCommands();
});
}
else
InitialSyncComplete = false;