Esempio n. 1
0
        private void RemoveResponses(string correlationId)
        {
            if (correlationId == null)
            {
                Debug.WriteLine("Attempting to remove responses with a null cor id. Not removing any responses.");
                return;
            }

            using (MessageQueue inQ = GetJobResponseQueue())
            {
                Message m = null;
                do
                {
                    m = MqHelper.GetMessageByCorId(inQ, correlationId, TimeSpan.FromMilliseconds(10));
                }while (m != null);
            }
        }
Esempio n. 2
0
        private FHistorgram GetResponseFromMq(string requestMsgId)
        {
            using (MessageQueue inQ = GetJobResponseQueue())
            {
                Message m = MqHelper.GetMessageByCorId(inQ, requestMsgId, WaitDuration);

                if (m == null)
                {
                    Debug.WriteLine("The FHistogram did not arrive.");
                    return(null);
                }

                Debug.WriteLine("Received a message.");
                FHistorgram result = (FHistorgram)m.Body;

                return(result);
            }
        }
Esempio n. 3
0
        private SCoords GetResponseFromMq(string requestMsgId)
        {
            using (MessageQueue inQ = GetJobResponseQueue())
            {
                Message m = MqHelper.GetMessageByCorId(inQ, requestMsgId, WaitDuration);

                if (m == null)
                {
                    Debug.WriteLine("The FCoordsResult did not arrive.");
                    return(null);
                }

                Debug.WriteLine("Received a message.");
                FCoordsResult jobResult = (FCoordsResult)m.Body;

                MqMessages.Coords coords = jobResult.Coords;

                SPoint  leftBot  = new SPoint(coords.StartX, coords.StartY);
                SPoint  rightTop = new SPoint(coords.EndX, coords.EndY);
                SCoords result   = new SCoords(leftBot, rightTop);

                return(result);
            }
        }