@@ -34,9 +34,9 @@ public partial class HttpApiFactory : IHttpApiFactory, _IHttpApiFactory
3434 private readonly Func < Type , Lazy < ActiveHandlerEntry > > activeEntryFactory ;
3535
3636 /// <summary>
37- /// http接口客户端选项
37+ /// http接口代理创建选项
3838 /// </summary>
39- private readonly ConcurrentDictionary < Type , TypedClientOption > typedClientOptions ;
39+ private readonly ConcurrentDictionary < Type , HttpApiCreateOption > httpApiCreateOptions ;
4040
4141 /// <summary>
4242 /// 激活的记录
@@ -99,7 +99,7 @@ public HttpApiFactory()
9999 {
100100 this . expiredEntries = new ConcurrentQueue < ExpiredHandlerEntry > ( ) ;
101101 this . activeEntries = new ConcurrentDictionary < Type , Lazy < ActiveHandlerEntry > > ( ) ;
102- this . typedClientOptions = new ConcurrentDictionary < Type , TypedClientOption > ( ) ;
102+ this . httpApiCreateOptions = new ConcurrentDictionary < Type , HttpApiCreateOption > ( ) ;
103103 this . activeEntryFactory = apiType => new Lazy < ActiveHandlerEntry > ( ( ) => this . CreateActiveEntry ( apiType ) , LazyThreadSafetyMode . ExecutionAndPublication ) ;
104104
105105 this . RegisteCleanup ( ) ;
@@ -119,13 +119,13 @@ public void AddHttpApi<TInterface>(Action<HttpApiConfig> config, Func<HttpMessag
119119 handlerFactory = ( ) => new DefaultHttpClientHandler ( ) ;
120120 }
121121
122- var options = new TypedClientOption
122+ var options = new HttpApiCreateOption
123123 {
124124 ConfigAction = config ,
125125 HandlerFactory = handlerFactory
126126 } ;
127127
128- var state = this . typedClientOptions . TryAdd ( typeof ( TInterface ) , options ) ;
128+ var state = this . httpApiCreateOptions . TryAdd ( typeof ( TInterface ) , options ) ;
129129 if ( state == false )
130130 {
131131 throw new InvalidOperationException ( $ "接口{ typeof ( TInterface ) } 不能重复注册") ;
@@ -151,7 +151,7 @@ public TInterface CreateHttpApi<TInterface>() where TInterface : class, IHttpApi
151151 /// <returns></returns>
152152 private ActiveHandlerEntry CreateActiveEntry ( Type apiType )
153153 {
154- if ( this . typedClientOptions . TryGetValue ( apiType , out var option ) == false )
154+ if ( this . httpApiCreateOptions . TryGetValue ( apiType , out var option ) == false )
155155 {
156156 throw new ArgumentException ( $ "未注册的接口类型{ apiType } ") ;
157157 }
0 commit comments