1
0
mirror of https://github.com/redis/go-redis.git synced 2025-06-16 23:40:55 +03:00

Add proper SingleConnPool implementation

This commit is contained in:
Vladimir Mihailenco
2019-08-03 17:21:12 +03:00
parent d6a99e7be3
commit 4e9cea8876
7 changed files with 212 additions and 69 deletions

View File

@ -151,6 +151,27 @@ func ExampleClient() {
// missing_key does not exist
}
func ExampleConn() {
conn := redisdb.Conn()
err := conn.ClientSetName("foobar").Err()
if err != nil {
panic(err)
}
// Open other connections.
for i := 0; i < 10; i++ {
go redisdb.Ping()
}
s, err := conn.ClientGetName().Result()
if err != nil {
panic(err)
}
fmt.Println(s)
// Output: foobar
}
func ExampleClient_Set() {
// Last argument is expiration. Zero means the key has no
// expiration time.