Ejemplo n.º 1
0
 public void Enqueue(Request request)
 {
     if (!requestQueue.ContainsKey(request.RequestId))
     {
         requestQueue.Add(request.RequestId, request);
         if (RequestQueueChanged != null)
             RequestQueueChanged(this, new RequestQueueEventArgs(request, requestQueue.Count));
     }
 }
Ejemplo n.º 2
0
 public void Remove(Request request)
 {
     if (requestQueue.ContainsKey(request.RequestId))
     {
         requestQueue.Remove(request.RequestId);
         if (RequestQueueChanged != null)
             RequestQueueChanged(this, new RequestQueueEventArgs(request, requestQueue.Count));
     }
 }
Ejemplo n.º 3
0
 public void Enqueue(Request request)
 {
     IList<Request> results = dbService.Load<Request>(delegate(Request queryRequest) {
         return queryRequest.RequestId == request.RequestId;
     });
     if (results.Count == 0)
     {
         dbService.Store(request);
         if (RequestQueueChanged != null)
             RequestQueueChanged(this, new RequestQueueEventArgs(request, GetCount()));
     }
 }
Ejemplo n.º 4
0
 public RequestQueueEventArgs(Request request, int queueSize)
 {
     this.request = request;
     this.queueSize = queueSize;
 }
Ejemplo n.º 5
0
 public void Remove(Request request)
 {
     IList<Request> results = dbService.Load<Request>(delegate(Request queryRequest) {
         return request.RequestId == queryRequest.RequestId;
     });
     if (results.Count > 0)
     {
         dbService.Delete(results[0]);
         if (RequestQueueChanged != null)
             RequestQueueChanged(this, new RequestQueueEventArgs(results[0], GetCount()));
     }
 }
Ejemplo n.º 6
0
 /// <summary>
 /// 构造函数(重载)
 /// </summary>
 /// <param name="request">请求对象</param>
 /// <param name="exception">执行请求时抛出的异常</param>
 public ThreadPoolInvoker(Request request, Exception exception)
     : this(request)
 {
     this.exception = exception;
 }
Ejemplo n.º 7
0
 /// <summary>
 /// 构造函数
 /// </summary>
 /// <param name="request">请求对象</param>
 public ThreadPoolInvoker(Request request)
 {
     this.request = request;
 }
		/// <summary>
		/// It creates an RequestDispatchedEventArgs for the given request and result.
		/// It is used by the RequestDispatched event, fired during the dispatch process.
		/// </summary>
		/// <param name="request">Request tried to be dispatched.</param>
		/// <param name="result">Dispatch process result.</param>
		public RequestDispatchedEventArgs(Request request, DispatchResult result)
		{
			this.request = request;
			this.result = result;
		}
Ejemplo n.º 9
0
 public RemoteCallExceptionEventArgs(Request request, Exception exception)
 {
     this.request = request;
     this.exception = exception;
 }
Ejemplo n.º 10
0
 public RemoteCallReturnEventArgs(Request request)
 {
     this.request = request;
 }