예제 #1
0
        /// <summary>
        /// Enqueues a request for processing.
        /// </summary>
        /// <param name="request"></param>
        /// <returns>Unique handle to the request</returns>
        static public AsyncProcessingResult EnqueueRequest(HttpWebRequest request)
        {
            string reqId = Guid.NewGuid().ToString();
            AsyncProcessingResult resultHandle = new AsyncProcessingResult();

            resultHandle.Key = reqId;
            lock (requestQueue)
            {
                requestQueue.Enqueue(new QueuedRequest(reqId, request, resultHandle));
            }
            QueueWatcherObject.CheckQueue();

            return(resultHandle);
        }
예제 #2
0
 public QueuedRequest(string requestId, HttpWebRequest request, AsyncProcessingResult asyncResultHandle)
 {
     RequestId         = requestId;
     Request           = request;
     AsyncResultHandle = asyncResultHandle;
 }