11// Copyright (c) Microsoft. All rights reserved.
22// Licensed under the MIT license. See LICENSE file in the project root for full license information.
33
4+ using System ;
45using System . Threading ;
56using System . Threading . Tasks ;
67
@@ -11,7 +12,6 @@ internal class HubServiceEndpoint : ServiceEndpoint
1112 private readonly ServiceEndpoint _endpoint ;
1213 private readonly long _uniqueIndex ;
1314 private static long s_currentIndex ;
14- private static bool _pendingReload ;
1515 private TaskCompletionSource < bool > _scaleTcs ;
1616
1717 public HubServiceEndpoint (
@@ -23,7 +23,6 @@ ServiceEndpoint endpoint
2323 Hub = hub ;
2424 Provider = provider ;
2525 _endpoint = endpoint ;
26- _pendingReload = endpoint . PendingReload ;
2726 _scaleTcs = endpoint . PendingReload ? new TaskCompletionSource < bool > ( TaskCreationOptions . RunContinuationsAsynchronously ) : null ;
2827 _uniqueIndex = Interlocked . Increment ( ref s_currentIndex ) ;
2928 }
@@ -43,14 +42,12 @@ ServiceEndpoint endpoint
4342
4443 public void CompleteScale ( )
4544 {
46- _pendingReload = false ;
4745 _scaleTcs ? . TrySetResult ( true ) ;
4846 }
4947
5048 // When remove an existing HubServiceEndpoint.
5149 public void ResetScale ( )
5250 {
53- _pendingReload = true ;
5451 _scaleTcs = new TaskCompletionSource < bool > ( TaskCreationOptions . RunContinuationsAsynchronously ) ;
5552 }
5653
@@ -61,6 +58,7 @@ public override string ToString()
6158 return base . ToString ( ) + $ "(hub={ Hub } )";
6259 }
6360
64- internal override bool PendingReload => _pendingReload ;
61+ // Value here is not accurate.
62+ internal override bool PendingReload => throw new NotSupportedException ( ) ;
6563 }
6664}
0 commit comments