BewareMyPower commented on code in PR #336:
URL: https://github.com/apache/pulsar-client-cpp/pull/336#discussion_r1376990180
##########
lib/ConnectionPool.cc:
##########
@@ -34,13 +34,13 @@ DECLARE_LOG_OBJECT()
namespace pulsar {
ConnectionPool::ConnectionPool(const ClientConfiguration& conf,
ExecutorServiceProviderPtr executorProvider,
- const AuthenticationPtr& authentication, bool
poolConnections,
- const std::string& clientVersion)
+ const AuthenticationPtr& authentication, const
std::string& clientVersion)
: clientConfiguration_(conf),
executorProvider_(executorProvider),
authentication_(authentication),
- poolConnections_(poolConnections),
- clientVersion_(clientVersion) {}
+ clientVersion_(clientVersion),
+ randomDistribution_(0, conf.getConnectionsPerBroker()),
Review Comment:
My fault. It's true that `uniform_int_distribution` uses right-closed range.
I wanted to say we should use a left-closed and right-open range: `[0,
connectionsPerBroker)` so the initialization of `uniform_int_distribution`
should be:
```c++
randomDistribution_(0, conf.getConnectionsPerBroker() - 1),
```
@RobertIndie
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]