Exemplo n.º 1
0
        public WebRpcHandler(string baseUrl,
            Dictionary<string, object> environment, HttpRequestQueue queue,
            IRpcHandlerAppCounters rpcAppCounters = null, 
            HttpRequestQueueOptions httpRequestQueueOptions = null)
        {
            this.rpcAppCounters = rpcAppCounters ?? nullAppCounters;
            this.baseUrl = baseUrl;
            this.environment = environment;

            if (httpRequestQueueOptions == null)
            {
                httpRequestQueueOptions = new HttpRequestQueueOptions();
            }

            this.httpRequestQueue = queue;
            this.httpRequestQueue.SetCounters(this);

            this.httpRequestQueue.MaxErrorRequests = httpRequestQueueOptions.HttpQueueMaxTimeouts;
            this.httpRequestQueue.MaxTimedOutRequests = httpRequestQueueOptions.HttpQueueMaxErrors;
            this.httpRequestQueue.ReconnectInterval = TimeSpan.FromMilliseconds(httpRequestQueueOptions.HttpQueueReconnectInterval);
            this.httpRequestQueue.QueueTimeout = TimeSpan.FromMilliseconds(httpRequestQueueOptions.HttpQueueQueueTimeout);
            this.httpRequestQueue.MaxQueuedRequests = httpRequestQueueOptions.HttpQueueMaxQueuedRequests;
            this.httpRequestQueue.MaxBackoffInMilliseconds = httpRequestQueueOptions.HttpQueueMaxBackoffTime;
            this.httpRequestQueue.MaxConcurrentRequests = httpRequestQueueOptions.HttpQueueMaxConcurrentRequests;

            this.httpRequestTimeout = httpRequestQueueOptions.HttpQueueRequestTimeout;
        }
Exemplo n.º 2
0
 public WebRpcHandler(string baseUrl,
     Dictionary<string, object> environment,
     IRpcHandlerAppCounters rpcAppCounters = null,
     HttpRequestQueueOptions httpRequestQueueOptions = null)
     : this(baseUrl, environment, new HttpRequestQueue(), rpcAppCounters, httpRequestQueueOptions)
 {
 }
Exemplo n.º 3
0
 public WebRpcHandler(string baseUrl,
                      Dictionary <string, object> environment,
                      IRpcHandlerAppCounters rpcAppCounters           = null,
                      HttpRequestQueueOptions httpRequestQueueOptions = null)
     : this(baseUrl, environment, new HttpRequestQueue(), rpcAppCounters, httpRequestQueueOptions)
 {
 }
Exemplo n.º 4
0
        public WebRpcHandler(string baseUrl,
                             Dictionary <string, object> environment, HttpRequestQueue queue,
                             IRpcHandlerAppCounters rpcAppCounters           = null,
                             HttpRequestQueueOptions httpRequestQueueOptions = null)
        {
            this.rpcAppCounters = rpcAppCounters ?? nullAppCounters;
            this.baseUrl        = baseUrl;
            this.environment    = environment;

            if (httpRequestQueueOptions == null)
            {
                httpRequestQueueOptions = new HttpRequestQueueOptions();
            }

            this.httpRequestQueue = queue;
            this.httpRequestQueue.SetCounters(this);

            this.httpRequestQueue.MaxErrorRequests         = httpRequestQueueOptions.HttpQueueMaxTimeouts;
            this.httpRequestQueue.MaxTimedOutRequests      = httpRequestQueueOptions.HttpQueueMaxErrors;
            this.httpRequestQueue.ReconnectInterval        = TimeSpan.FromMilliseconds(httpRequestQueueOptions.HttpQueueReconnectInterval);
            this.httpRequestQueue.QueueTimeout             = TimeSpan.FromMilliseconds(httpRequestQueueOptions.HttpQueueQueueTimeout);
            this.httpRequestQueue.MaxQueuedRequests        = httpRequestQueueOptions.HttpQueueMaxQueuedRequests;
            this.httpRequestQueue.MaxBackoffInMilliseconds = httpRequestQueueOptions.HttpQueueMaxBackoffTime;
            this.httpRequestQueue.MaxConcurrentRequests    = httpRequestQueueOptions.HttpQueueMaxConcurrentRequests;

            this.httpRequestTimeout = httpRequestQueueOptions.HttpQueueRequestTimeout;
        }
        public WebRpcHandler(string baseUrl, Dictionary <string, object> environment, HttpRequestQueue queue,
                             int httpQueueRequestTimeout, IRpcHandlerAppCounters rpcAppCounters = null)
        {
            this.rpcAppCounters = rpcAppCounters ?? nullAppCounters;
            this.baseUrl        = baseUrl;
            this.environment    = environment;

            this.httpRequestQueue = queue;
            this.httpRequestQueue.SetCounters(this);
            this.httpRequestTimeout = httpQueueRequestTimeout;
        }