Example #1
0
            public JobStatus HandleJobStatus(ObjectId recordid)
            {
                RestAPI api             = new RestAPI();
                string  recordIdStr     = recordid.ToString();
                JObject obj             = api.StatusRequest(recordIdStr);
                bool    messageReceived = obj.GetValue("Successful").Value <bool>();
                int     attempts        = 0;

                while ((!messageReceived) && (attempts < maxRequestAttempts))
                {
                    obj             = api.StatusRequest(recordIdStr);
                    messageReceived = obj.GetValue("Successful").Value <bool>();
                    attempts++;
                }
                Tuple <ServerResponse, JobStatus> response = api.ParseStatusResponse(obj);

                return(response.Item2);
            }