-
Notifications
You must be signed in to change notification settings - Fork 69
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactoring to prepare for async methods #198
Conversation
…nager to simplify the logic in LoadBalancer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@zhenlineo changes look good, couple small comments.
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this licence header needed?
} | ||
} | ||
|
||
public class TryAcquireConnectionMethod |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This class is probably not needed
} | ||
} | ||
} | ||
var name = mode == AccessMode.Read ? "read" : "wrtie"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe mode.ToString().ToLower()
? Just to avoid manual string conversion
@@ -32,22 +32,23 @@ internal class RoundRobinRoutingTable : IRoutingTable | |||
private readonly Stopwatch _stopwatch; | |||
private readonly long _expireAfterSeconds; | |||
|
|||
public RoundRobinRoutingTable(Stopwatch stopwatch, long expireAfterSeconds = 0) | |||
public RoundRobinRoutingTable(IEnumerable<Uri> routers, long expireAfterSeconds = 0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This constructor may call the other one using Enumerable.Empty() for readers and writers parameters.
Refactoring to pull RoutingTable and Rediscovery in to RoutingTableManager to simplify the logic in LoadBalancer.