@@ -29,15 +29,15 @@ protected enum SocketEventNameTypes
2929 CamelCase ,
3030 }
3131
32- private const int PropertyTimeout = 1000 ;
32+ private const int InvocationTimeout = 1000 ;
3333
3434 private readonly string objectName ;
35- private readonly ConcurrentDictionary < string , PropertyGetter > propertyGetters ;
36- private readonly ConcurrentDictionary < string , string > propertyEventNames = new ( ) ;
37- private readonly ConcurrentDictionary < string , string > propertyMessageNames = new ( ) ;
35+ private readonly ConcurrentDictionary < string , Invocator > invocators ;
36+ private readonly ConcurrentDictionary < string , string > invocationEventNames = new ( ) ;
37+ private readonly ConcurrentDictionary < string , string > invocationMessageNames = new ( ) ;
3838 private readonly ConcurrentDictionary < string , string > methodMessageNames = new ( ) ;
3939 private static readonly ConcurrentDictionary < string , EventContainer > eventContainers = new ( ) ;
40- private static readonly ConcurrentDictionary < string , ConcurrentDictionary < string , PropertyGetter > > AllPropertyGetters = new ( ) ;
40+ private static readonly ConcurrentDictionary < string , ConcurrentDictionary < string , Invocator > > AllInvocators = new ( ) ;
4141
4242 private readonly object objLock = new object ( ) ;
4343
@@ -58,7 +58,7 @@ protected set
5858 protected ApiBase ( )
5959 {
6060 this . objectName = this . GetType ( ) . Name . LowerFirst ( ) ;
61- propertyGetters = AllPropertyGetters . GetOrAdd ( objectName , _ => new ConcurrentDictionary < string , PropertyGetter > ( ) ) ;
61+ this . invocators = AllInvocators . GetOrAdd ( objectName , _ => new ConcurrentDictionary < string , Invocator > ( ) ) ;
6262 }
6363
6464 protected void CallMethod0 ( [ CallerMemberName ] string callerName = null )
@@ -113,21 +113,21 @@ protected void CallMethod3(object val1, object val2, object val3, [CallerMemberN
113113 }
114114 }
115115
116- protected Task < T > GetPropertyAsync < T > ( object arg = null , [ CallerMemberName ] string callerName = null )
116+ protected Task < T > InvokeAsync < T > ( object arg = null , [ CallerMemberName ] string callerName = null )
117117 {
118118 Debug . Assert ( callerName != null , nameof ( callerName ) + " != null" ) ;
119119
120120 lock ( this . objLock )
121121 {
122- return this . propertyGetters . GetOrAdd ( callerName , _ =>
122+ return this . invocators . GetOrAdd ( callerName , _ =>
123123 {
124- var getter = new PropertyGetter < T > ( this , callerName , PropertyTimeout , arg ) ;
124+ var getter = new Invocator < T > ( this , callerName , InvocationTimeout , arg ) ;
125125
126126 getter . Task < T > ( ) . ContinueWith ( _ =>
127127 {
128128 lock ( this . objLock )
129129 {
130- return this . propertyGetters . TryRemove ( callerName , out var _ ) ;
130+ return this . invocators . TryRemove ( callerName , out var _ ) ;
131131 }
132132 } ) ;
133133
@@ -228,17 +228,17 @@ private string EventKey(string eventName, int? id)
228228 return string . Format ( CultureInfo . InvariantCulture , "{0}{1:D}" , eventName , id ) ;
229229 }
230230
231- internal abstract class PropertyGetter
231+ internal abstract class Invocator
232232 {
233233 public abstract Task < T > Task < T > ( ) ;
234234 }
235235
236- internal class PropertyGetter < T > : PropertyGetter
236+ internal class Invocator < T > : Invocator
237237 {
238238 private readonly Task < T > tcsTask ;
239239 private TaskCompletionSource < T > tcs ;
240240
241- public PropertyGetter ( ApiBase apiBase , string callerName , int timeoutMs , object arg = null )
241+ public Invocator ( ApiBase apiBase , string callerName , int timeoutMs , object arg = null )
242242 {
243243 this . tcs = new TaskCompletionSource < T > ( TaskCreationOptions . RunContinuationsAsynchronously ) ;
244244 this . tcsTask = this . tcs . Task ;
@@ -249,10 +249,10 @@ public PropertyGetter(ApiBase apiBase, string callerName, int timeoutMs, object
249249 switch ( apiBase . SocketTaskEventNameType )
250250 {
251251 case SocketTaskEventNameTypes . DashesLowerFirst :
252- eventName = apiBase . propertyEventNames . GetOrAdd ( callerName , s => $ "{ apiBase . objectName } -{ s . StripAsync ( ) . LowerFirst ( ) } -completed") ;
252+ eventName = apiBase . invocationEventNames . GetOrAdd ( callerName , s => $ "{ apiBase . objectName } -{ s . StripAsync ( ) . LowerFirst ( ) } -completed") ;
253253 break ;
254254 case SocketTaskEventNameTypes . NoDashUpperFirst :
255- eventName = apiBase . propertyEventNames . GetOrAdd ( callerName , s => $ "{ apiBase . objectName } { s . StripAsync ( ) } Completed") ;
255+ eventName = apiBase . invocationEventNames . GetOrAdd ( callerName , s => $ "{ apiBase . objectName } { s . StripAsync ( ) } Completed") ;
256256 break ;
257257 default :
258258 throw new ArgumentOutOfRangeException ( ) ;
@@ -261,10 +261,10 @@ public PropertyGetter(ApiBase apiBase, string callerName, int timeoutMs, object
261261 switch ( apiBase . SocketTaskMessageNameType )
262262 {
263263 case SocketTaskMessageNameTypes . DashesLowerFirst :
264- messageName = apiBase . propertyMessageNames . GetOrAdd ( callerName , s => $ "{ apiBase . objectName } -{ s . StripAsync ( ) . LowerFirst ( ) } ") ;
264+ messageName = apiBase . invocationMessageNames . GetOrAdd ( callerName , s => $ "{ apiBase . objectName } -{ s . StripAsync ( ) . LowerFirst ( ) } ") ;
265265 break ;
266266 case SocketTaskMessageNameTypes . NoDashUpperFirst :
267- messageName = apiBase . propertyMessageNames . GetOrAdd ( callerName , s => apiBase . objectName + s . StripAsync ( ) ) ;
267+ messageName = apiBase . invocationMessageNames . GetOrAdd ( callerName , s => apiBase . objectName + s . StripAsync ( ) ) ;
268268 break ;
269269 default :
270270 throw new ArgumentOutOfRangeException ( ) ;
@@ -299,7 +299,7 @@ public PropertyGetter(ApiBase apiBase, string callerName, int timeoutMs, object
299299 _ = apiBase . Id >= 0 ? BridgeConnector . Socket . Emit ( messageName , apiBase . Id ) : BridgeConnector . Socket . Emit ( messageName ) ;
300300 }
301301
302- System . Threading . Tasks . Task . Delay ( PropertyTimeout ) . ContinueWith ( _ =>
302+ System . Threading . Tasks . Task . Delay ( InvocationTimeout ) . ContinueWith ( _ =>
303303 {
304304 if ( this . tcs != null )
305305 {
0 commit comments