connection info in connection pool progress
This commit is contained in:
@@ -62,7 +62,8 @@ connection &connection::operator=(const connection &x) {
|
||||
connection::connection( connection&& x ) noexcept
|
||||
: connection_info_(std::move(x.connection_info_))
|
||||
, connection_(std::move(x.connection_))
|
||||
, logger_(std::move(x.logger_)) {}
|
||||
, logger_(std::move(x.logger_))
|
||||
{}
|
||||
|
||||
connection & connection::operator=(connection &&x) noexcept {
|
||||
connection_info_ = std::move(x.connection_info_);
|
||||
|
||||
@@ -2,9 +2,10 @@
|
||||
|
||||
#include <chrono>
|
||||
#include <thread>
|
||||
#include <utility>
|
||||
|
||||
namespace matador::sql {
|
||||
identifiable_connection::identifiable_connection(const size_t id, connection &&conn)
|
||||
identifiable_connection::identifiable_connection(const size_t id, connection conn)
|
||||
: id(id)
|
||||
, conn(std::move(conn)){}
|
||||
|
||||
@@ -58,7 +59,10 @@ connection_pool::connection_pool(const std::string& dns, size_t count)
|
||||
connection_repo_.reserve(count);
|
||||
while (count) {
|
||||
connection c(info_);
|
||||
connection_repo_.emplace_back(count, std::move(c));
|
||||
auto&& cc = std::move(c);
|
||||
const auto ic = identifiable_connection{count, std::move(cc)};
|
||||
connection_repo_.push_back(ic);
|
||||
// connection_repo_.emplace_back(count, std::move(cc));
|
||||
// connection_repo_.emplace_back(count, connection{info_});
|
||||
auto &conn = connection_repo_.back();
|
||||
idle_connections_.emplace(conn.id, &conn);
|
||||
|
||||
Reference in New Issue
Block a user