Skip to content

Commit 8a2f2fc

Browse files
committed
[3.5.2] expose wait_for_removal in .disconnect of redis_client redis_subcriber future_client #74
1 parent e89b710 commit 8a2f2fc

File tree

6 files changed

+8
-8
lines changed

6 files changed

+8
-8
lines changed

includes/cpp_redis/future_client.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ class future_client {
6161

6262
//! handle connection
6363
void connect(const std::string& host = "127.0.0.1", std::size_t port = 6379, const disconnection_handler_t& disconnection_handler = nullptr);
64-
void disconnect(void);
64+
void disconnect(bool wait_for_removal = false);
6565
bool is_connected();
6666

6767
//! send cmd

includes/cpp_redis/redis_client.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ class redis_client {
5454
typedef std::function<void(redis_client&)> disconnection_handler_t;
5555
void connect(const std::string& host = "127.0.0.1", std::size_t port = 6379,
5656
const disconnection_handler_t& disconnection_handler = nullptr);
57-
void disconnect(void);
57+
void disconnect(bool wait_for_removal = false);
5858
bool is_connected(void);
5959

6060
//! send cmd

includes/cpp_redis/redis_subscriber.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ class redis_subscriber {
4949
//! handle connection
5050
typedef std::function<void(redis_subscriber&)> disconnection_handler_t;
5151
void connect(const std::string& host = "127.0.0.1", std::size_t port = 6379, const disconnection_handler_t& disconnection_handler = nullptr);
52-
void disconnect(void);
52+
void disconnect(bool wait_for_removal = false);
5353
bool is_connected(void);
5454

5555
//! ability to authenticate on the redis server if necessary

sources/future_client.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ future_client::connect(const std::string& host, std::size_t port, const disconne
4444
}
4545

4646
void
47-
future_client::disconnect(void) { m_client.disconnect(); }
47+
future_client::disconnect(bool wait_for_removal) { m_client.disconnect(wait_for_removal); }
4848

4949
bool
5050
future_client::is_connected(void) { return m_client.is_connected(); }

sources/redis_client.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,9 @@ redis_client::connect(const std::string& host, std::size_t port,
5656
}
5757

5858
void
59-
redis_client::disconnect(void) {
59+
redis_client::disconnect(bool wait_for_removal) {
6060
__CPP_REDIS_LOG(debug, "cpp_redis::redis_client attempts to disconnect");
61-
m_client.disconnect();
61+
m_client.disconnect(wait_for_removal);
6262
__CPP_REDIS_LOG(info, "cpp_redis::redis_client disconnected");
6363
}
6464

sources/redis_subscriber.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,9 @@ redis_subscriber::auth(const std::string& password, const reply_callback_t& repl
7070
}
7171

7272
void
73-
redis_subscriber::disconnect(void) {
73+
redis_subscriber::disconnect(bool wait_for_removal) {
7474
__CPP_REDIS_LOG(debug, "cpp_redis::redis_subscriber attempts to disconnect");
75-
m_client.disconnect();
75+
m_client.disconnect(wait_for_removal);
7676
__CPP_REDIS_LOG(info, "cpp_redis::redis_subscriber disconnected");
7777
}
7878

0 commit comments

Comments
 (0)