You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+15-3Lines changed: 15 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -133,6 +133,7 @@ local redis, err = rc:connect{
133
133
134
134
*[new](#new)
135
135
*[connect](#connect)
136
+
*[set_keepalive](#set_keepalive)
136
137
*[Utilities](#utilities)
137
138
*[connect_via_sentinel](#connect_via_sentinel)
138
139
*[try_hosts](#try_hosts)
@@ -143,16 +144,27 @@ local redis, err = rc:connect{
143
144
144
145
### new
145
146
146
-
`syntax: rc = redis_connector.new()`
147
+
`syntax: rc = redis_connector.new(params)`
147
148
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.
149
150
150
151
151
152
### connect
152
153
153
154
`syntax: redis, err = rc:connect(params)`
154
155
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.
0 commit comments