redis-plus-plus icon indicating copy to clipboard operation
redis-plus-plus copied to clipboard

[QUESTION]

Open Sivasundareswaran opened this issue 1 year ago • 1 comments

Hi Team , can you tell me how to reuse and keep Redis object in c++ applications .

Code : sw::redis::ConnectionOptions connection_options; connection_options.host = "10.xx.xx.xx"; connection_options.port = 6379; connection_options.password = "#######"; connection_options.socket_timeout = std::chrono::milliseconds(200); sw::redis::Redis redis(connection_options);

I am able to create and publish but not able to reuse the redis object out of the scope ,also not able to keep ,

Thanks in advance!!

Sivasundareswaran avatar Aug 11 '22 12:08 Sivasundareswaran

What do you mean by reusing Redis object out of scope? If an object, no matter it’s Redis or other c++ object, is out of scope, you can not use it. What do you really want to do?

Regards

sewenew avatar Aug 12 '22 13:08 sewenew

What do you mean by reusing Redis object out of scope? If an object, no matter it’s Redis or other c++ object, is out of scope, you can not use it. What do you really want to do?

Regards

Hi Thanks for the replay, Like I am creating redis object using connection options but I can't able to store that into to structure, that is the reason I raised, But now after went through multiple website, I came to konw how to create and store, now I can able to store.

Sivasundareswaran avatar Aug 13 '22 20:08 Sivasundareswaran