Add custom command example.

This commit is contained in:
Vladimir Mihailenco 2012-07-27 14:53:23 +03:00
parent 9c5def7f1f
commit 5af57e5ca6
1 changed files with 16 additions and 0 deletions

View File

@ -122,3 +122,19 @@ Thread safety
------------- -------------
Client is thread safe. Internally sync.Mutex is used to synchronize writes and reads. Client is thread safe. Internally sync.Mutex is used to synchronize writes and reads.
Custom commands
---------------
Example:
func Get(client *redis.Client, key string) *redis.BulkReq {
req := redis.NewBulkReq("GET", key)
client.Run(req)
return req
}
value, err := Get(redisClient).Reply()
if err != nil {
panic(err)
}