sewenew / redis-plus-plus

Redis client written in C++
Apache License 2.0
1.64k stars 351 forks source link

[QUESTION] In a single thread CONNECTION or thread pool, how do I actively close the connection after the data operation is completed, and I am a short connection to the data operation #395

Closed PrettySea closed 2 years ago

PrettySea commented 2 years ago

Before Asking A Question The README.md file has a detailed introduction with examples on how to use redis-plus-plus, and redis.h has doxgen style comments for most commands. Before asking a question, please try to find answers with these two files.

For general questions on redis-plus-plus, you can ask questions at StackOverflow with redis tag, and normally, you'll get faster response on StackOverflow.

However, if you still don't get answers, feel free to ask a question here.

Describe the problem A clear and concise description of the problem, with minimal code to reproduce the problem.

Environment:

Additional context Add any other context about the problem here.

sewenew commented 2 years ago

Destroy the Redis object you created, e.g. delete a dynamically allocated Redis object. When Redis' destructor is called, all connections will be closed.

Regards

PrettySea commented 2 years ago

ok,thanks for your help!