Exemplo n.º 1
0
        /// <inheritdoc/>
        public TimeSpan Create(string name, out HttpMessageHandler handler)
        {
            var resource = name == kDefaultResourceId ? null : name;
            var del      = new HttpHandlerDelegate(new HttpClientHandler(), resource,
                                                   _handlers.Where(h => h.IsFor?.Invoke(resource) ?? true),
                                                   _proxy, _logger);

            handler = del;
            return(del.MaxLifetime);
        }
Exemplo n.º 2
0
        /// <inheritdoc/>
        public TimeSpan Create(string name, out HttpMessageHandler handler)
        {
            var resource = name == DefaultResourceId ? null : name;

#pragma warning disable IDE0067 // Dispose objects before losing scope
            var del = new HttpHandlerDelegate(new HttpClientHandler(), resource,
#pragma warning restore IDE0067 // Dispose objects before losing scope
                                              _handlers.Where(h => h.IsFor?.Invoke(resource) ?? true),
                                              _proxy, _logger);
            handler = del;
            return(del.MaxLifetime);
        }
Exemplo n.º 3
0
        /// <inheritdoc/>
        public TimeSpan Create(string name, out HttpMessageHandler handler)
        {
            var resource = name == DefaultResourceId ? Resource.None : name;

            if (resource != null && resource.StartsWith(Resource.Local))
            {
                resource = resource.Remove(0, Resource.Local.Length);
            }
#pragma warning disable IDE0067 // Dispose objects before losing scope
            var del = new HttpHandlerDelegate(new HttpClientHandler(), resource,
#pragma warning restore IDE0067 // Dispose objects before losing scope
                                              _handlers.Where(h => h.IsFor?.Invoke(resource) ?? true),
                                              _proxy, _logger);
            handler = del;
            return(del.MaxLifetime);
        }