#include <userver/storages/redis/dynamic_redis.hpp>
Manages dynamically created Redis clients.
Definition at line 59 of file dynamic_redis.hpp.
Public Member Functions | |
| void | Init (std::shared_ptr< impl::ThreadPools > thread_pools, testsuite::RedisControl testsuite_redis_control) |
| bool | AddClient (const std::string &name, const DynamicSettings &settings, dynamic_config::Source &config) |
| Adds a new client with the specified name and settings. | |
| bool | RemoveClient (const std::string &name) |
| Removes a client with the specified name. | |
| utils::SharedRef< Client > | GetDynamicClient (const std::string &name, storages::redis::RedisWaitConnected wait_connected={}) const |
| Retrieves a dynamically added client by name. | |
| std::unordered_set< std::string > | ListClients () const |
| Lists the names of all dynamically added clients. | |
| void | WriteStatistics (utils::statistics::Writer &writer, const MetricsSettings &settings) const |
| Writes statistics for all dynamic clients. | |
| void | OnConfigUpdate (const dynamic_config::Snapshot &cfg) |
| bool storages::redis::DynamicRedis::AddClient | ( | const std::string & | name, |
| const DynamicSettings & | settings, | ||
| dynamic_config::Source & | config ) |
Adds a new client with the specified name and settings.
| name | the name of the client |
| settings | the dynamic settings for the client |
| utils::SharedRef< Client > storages::redis::DynamicRedis::GetDynamicClient | ( | const std::string & | name, |
| storages::redis::RedisWaitConnected | wait_connected = {} ) const |
Retrieves a dynamically added client by name.
| name | the name of the client |
| wait_connected | wait mode for the client connection |
| std::unordered_set< std::string > storages::redis::DynamicRedis::ListClients | ( | ) | const |
Lists the names of all dynamically added clients.
| bool storages::redis::DynamicRedis::RemoveClient | ( | const std::string & | name | ) |
Removes a client with the specified name.
| name | the name of the client to remove |
| void storages::redis::DynamicRedis::WriteStatistics | ( | utils::statistics::Writer & | writer, |
| const MetricsSettings & | settings ) const |
Writes statistics for all dynamic clients.
| writer | statistics writer |