Skip to content

Commit d2481dc

Browse files
committed
Merge branch 'master' of github.com:pintsized/lua-resty-redis-connector
2 parents 2f8680a + f6b4fdf commit d2481dc

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

README.md

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,7 @@ local redis, err = rc:connect{
133133

134134
* [new](#new)
135135
* [connect](#connect)
136+
* [set_keepalive](#set_keepalive)
136137
* [Utilities](#utilities)
137138
* [connect_via_sentinel](#connect_via_sentinel)
138139
* [try_hosts](#try_hosts)
@@ -143,16 +144,27 @@ local redis, err = rc:connect{
143144

144145
### new
145146

146-
`syntax: rc = redis_connector.new()`
147+
`syntax: rc = redis_connector.new(params)`
147148

148-
Creates the Redis Connector object. In case of failures, returns `nil` and a string describing the error.
149+
Creates the Redis Connector object, overring default params with the ones given. In case of failures, returns `nil` and a string describing the error.
149150

150151

151152
### connect
152153

153154
`syntax: redis, err = rc:connect(params)`
154155

155-
Attempts to create a connection, according to the [params](#parameters) supplied. If a connection cannot be made, returns `nil` and a string describing the reason.
156+
Attempts to create a connection, according to the [params](#parameters) supplied, falling back to defaults given in `new` or the predefined defaults. If a connection cannot be made, returns `nil` and a string describing the reason.
157+
158+
159+
### set_keepalive
160+
161+
`syntax: ok, err = rc:set_keepalive(redis)`
162+
163+
Attempts to place the given Redis connection on the keepalive pool, according to timeout and poolsize params given in `new` or the predefined defaults.
164+
165+
This allows an application to release resources without having to keep track of application wide keepalive settings.
166+
167+
Returns `1` or in the case of error, `nil` and a string describing the error.
156168

157169

158170
## Utilities

0 commit comments

Comments
 (0)