6 #include <boost/noncopyable.hpp>
7 #include <redis3m/connection.h>
8 #include <boost/thread/mutex.hpp>
20 typedef boost::shared_ptr<simple_pool> ptr_t;
22 inline ptr_t create(
const std::string& host,
unsigned int port)
31 connection::ptr_t
get();
37 void put(connection::ptr_t conn);
44 inline void set_database(
unsigned int value) { _database = value; }
47 simple_pool(
const std::string& host,
unsigned int port);
51 unsigned int _database;
52 std::set<connection::ptr_t> connections;
53 boost::mutex access_mutex;
Manages a pool of connections to a single Redis server.
Definition: simple_pool.h:17
void put(connection::ptr_t conn)
Put back a connection for reuse.
Definition: simple_pool.cpp:39
void set_database(unsigned int value)
Set default database, all connection will be initialized selecting this database. ...
Definition: simple_pool.h:44