Chimney.MPD.ChimneyMPDBase.Response C# (CSharp) Method

Response() public method

public Response ( int qId ) : Task
qId int
return Task
        public async Task<string> Response(int qId)
        {
            QueueJob queueJob = new QueueJob();

            while (responseDictionary.ContainsKey(qId) == false
                && (responseDictionary.Count > 0 
                || sendQueue.Count > 0))
            {
                await Task.Delay(1);
            }

            if (responseDictionary.ContainsKey(qId))
            {
                queueJob = responseDictionary[qId];

                Debug.WriteLine(this.name + " : RETRIVE : qId: " + qId + " queueJob: " + queueJob.id);
                responseDictionary.Remove(qId);
            }

            return queueJob.response;
        }
    }