diff options
author | Ben Caimano <ben.caimano@10gen.com> | 2019-05-23 13:18:38 -0400 |
---|---|---|
committer | Ben Caimano <ben.caimano@10gen.com> | 2019-05-29 16:23:44 -0400 |
commit | 60008cd952996d5558b9fb4c5f66d1e2d1af0d4d (patch) | |
tree | 12bdd4ab9b3a2b31ea17dd619640a0ff668729c2 /src/mongo/executor/connection_pool.h | |
parent | ffd64883d70c9139d7b56d076e249f3fef77e54e (diff) | |
download | mongo-60008cd952996d5558b9fb4c5f66d1e2d1af0d4d.tar.gz |
SERVER-41318 Return SemiFutures for ConnectionPool
Diffstat (limited to 'src/mongo/executor/connection_pool.h')
-rw-r--r-- | src/mongo/executor/connection_pool.h | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/mongo/executor/connection_pool.h b/src/mongo/executor/connection_pool.h index 5944e7a527e..4c7da28ef27 100644 --- a/src/mongo/executor/connection_pool.h +++ b/src/mongo/executor/connection_pool.h @@ -76,9 +76,9 @@ public: using GetConnectionCallback = unique_function<void(StatusWith<ConnectionHandle>)>; static constexpr Milliseconds kDefaultHostTimeout = Milliseconds(300000); // 5mins - static const size_t kDefaultMaxConns; - static const size_t kDefaultMinConns; - static const size_t kDefaultMaxConnecting; + static constexpr size_t kDefaultMaxConns = std::numeric_limits<size_t>::max(); + static constexpr size_t kDefaultMinConns = 1; + static constexpr size_t kDefaultMaxConnecting = 2; static constexpr Milliseconds kDefaultRefreshRequirement = Milliseconds(60000); // 1min static constexpr Milliseconds kDefaultRefreshTimeout = Milliseconds(20000); // 20secs @@ -155,9 +155,9 @@ public: const stdx::function<transport::Session::TagMask(transport::Session::TagMask)>& mutateFunc) override; - Future<ConnectionHandle> get(const HostAndPort& hostAndPort, - transport::ConnectSSLMode sslMode, - Milliseconds timeout); + SemiFuture<ConnectionHandle> get(const HostAndPort& hostAndPort, + transport::ConnectSSLMode sslMode, + Milliseconds timeout); void get_forTest(const HostAndPort& hostAndPort, Milliseconds timeout, GetConnectionCallback cb); @@ -294,8 +294,8 @@ protected: * Making these protected makes the definitions available to override in * children. */ - using SetupCallback = stdx::function<void(ConnectionInterface*, Status)>; - using RefreshCallback = stdx::function<void(ConnectionInterface*, Status)>; + using SetupCallback = unique_function<void(ConnectionInterface*, Status)>; + using RefreshCallback = unique_function<void(ConnectionInterface*, Status)>; /** * Sets up the connection. This should include connection + auth + any |